Spule lädt das Bild nichtAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 Spule lädt das Bild nicht

Post by Anonymous »

Coil-Ladezustände blieben beim Laden hängen.
Die Internetberechtigung wurde mit Coil 2,7 festgelegt, daher sind keine zusätzlichen Importe erforderlich.
Beim Erstellen von Protokollen geht der AsyncImagePainterState jedoch nur zum Laden

Code: Select all

@Composable
fun SelfLoadingPicture(
pictureUrl: String,
modifier: Modifier = Modifier,
imageModifier: Modifier = Modifier,
loadingModifier: Modifier = Modifier,
placeholderPainter: Painter =     painterResource(R.drawable.ic_launcher_background),
contentDescription: String = "@null",
colorFilter: ColorFilter? = null,
) {
var isLoading by remember { mutableStateOf(true) }
var isError by remember { mutableStateOf(false) }
val imageLoader = rememberAsyncImagePainter(
model = pictureUrl,
onState = { state ->
isLoading = state is AsyncImagePainter.State.Loading
isError = state is AsyncImagePainter.State.Error
},
)
val isLocalInspection = LocalInspectionMode.current

LoadingBox(
isLoading = isLoading,
isError = isError,
isLocalInspection = isLocalInspection,
imageLoader = imageLoader,
modifier = modifier,
imageModifier = imageModifier,
loadingModifier = loadingModifier,
placeholderPainter = placeholderPainter,
contentDescription = contentDescription,
colorFilter = colorFilter,
)

}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post