Row(
modifier = Modifier.padding(16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
//Important image loading part
//Remembering of painter
val painter = rememberImagePainter(data = cat.photoUrl)
Image(
modifier = Modifier
.size(100.dp)
.clip(RoundedCornerShape(16.dp)),
//Use painter in Image composable
painter = painter,
contentDescription = "Cat"
)
//Rest of compose code
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter