我需要将Bitmap?或BitmapDrawable更改为ImageBitmap并用coil显示它--这是我的代码
val bitmap = BlurhashDecoder.decode(blurhash, 4, 3)
Image(
bitmap = bitmap as ImageBitmap,
modifier = modifier,
contentScale = ContentScale.Crop,
contentDescription = ""
)当我运行它时,我会得到这个错误。
java.lang.ClassCastException: android.graphics.Bitmap cannot be cast to androidx.compose.ui.graphics.ImageBitmap发布于 2022-04-19 13:42:23
使用bitmap.asImageBitmap()将bitmap转换为ImageBitmap
https://stackoverflow.com/questions/71925505
复制相似问题