[英]How to make transparent background in Box jetpack compose
我想在 jetpack compose 中使Box
的顏色透明。 我試過了,但它會產生白色背景。 有人可以指導我嗎?
@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)
這個或 Color.Unspecified 只繪制Color(0x00000000)
對於透明背景,您需要在 01 和 ff 之間設置前兩位數字,其他六位數字是 RRGGBB 基本上是 AARRGGBB
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.