I want to make transparent color of Box in jetpack compose. I tried but it makes white background. Can someone guide me on this?
@Composable
fun OnContentLoading() {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Transparent)
) {
CircularProgressIndicator(
modifier = Modifier.align(Alignment.Center),
color = Aqua
)
}
}
@Preview(showBackground = true)
@Composable
fun PreviewOnContentLoading() {
OnContentLoading()
}
Output

background(Color.Transparent)
This or Color.Unspecified draws nothing but Color(0x00000000)
for a transparent background you need to set first two digits between 01 and ff and other six digits are RRGGBB basically it's AARRGGBB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With