JetPack组合盒布局剪辑显示白色背景
撰写框布局在应用剪辑选项时显示白色背景,
Box( modifier = Modifier
.size(50.dp)
.clip(CircleShape)
.background(colorResource(id = R.color.black_trans))
)
是否有任何透明的方式来透明背景何时应用电路?
Compose Box layout showing white background when applying Clip Option
Box( modifier = Modifier
.size(50.dp)
.clip(CircleShape)
.background(colorResource(id = R.color.black_trans))
)
Is there any way to transparent the background when CircleClip is applied?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在修饰符顺序米中,所以我们最后必须添加背景。
In Modifier order metters so we have to add background at last.
https://developer.android.com/jetpack/compose/modifiers
https://developer.android.com/jetpack/compose/modifiers
在 Jetpack Compose 中,修饰符的顺序很重要。所以先添加背景色再剪辑。
修饰符参考: https://developer.android.com/jetpack/compose /修饰符#顺序修饰符-事项
In Jetpack Compose the order of the modifiers matters. So add background color first and then clip.
Modifier Reference: https://developer.android.com/jetpack/compose/modifiers#order-modifier-matters