How to set a drawable resource as a background to an Image in Jetpack compose?
Corresponding view XML code
<androidx.appcompat.widget.AppCompatImageView
android:background="@drawable/drawable_black_circle"
android:src="@drawable/app_logo"
...
/>
My current code,
Image(
painter = painterResource(id = R.drawable.app_logo),
contentDescription = null,
modifier = Modifier
.height(160.dp)
.width(160.dp)
.padding(32.dp),
)
Modifier.background() gives me the option to use color as a background.
Similarly looking for a way to use a drawable resource as a background.
Note:
Looking for a way to have the background in the image.
Not looking for enclosing the image inside another composable with the background.