Hey everyone, when using coil, the images aren’t b...
# compose
t
Hey everyone, when using coil, the images aren’t being cropped properly the first time they’re loaded, when using a placeholder. But when they’re cached it works fine… Here’s the code:
Copy code
Surface(
    shape = MaterialTheme.shapes.medium,
    modifier = Modifier
        .clip(MaterialTheme.shapes.medium)
        .size(imageSize),
) {
    Image(
        painter = rememberImagePainter(
                                data = imageUrl,
                                builder = {
                                    crossfade(true)
                                    error(R.drawable.ic_box)
                                    placeholder(R.drawable.ic_box)
                                },
                            ),
        contentDescription = null,
        contentScale = ContentScale.Crop,
        modifier = Modifier
            .fillMaxSize(),
    )
}
c
I would open up an issue/discussion in coil repo (you're using the new coil-compose artifact right?). The maintainer has helped me within a few hours on every request I've had. 😄