Skip to content

Adding a error image inside ImageRequest builder #2801

Answered by colinrtwhite
ismai117 asked this question in Q&A
Discussion options

You must be logged in to vote

If you're using a standard Android resource there's an extension function that you can import to make your code snippit work.

Alternatively you can pass it as a painter. This also works for Compose Multiplatform resources:

AsyncImage(
  model = imageRequest,
  error = painterResource(Res.drawable.ic_image_slash_small),
  contentDescription = null,
)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ismai117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants