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
CodePudding user response:
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