[英]How to add a shadow / border / elevation to an icon in Jetpack Compose
I would like to add a shadow to my icon in Jetpack compose, so that the image & text have a (roughly) similar shadow.我想在 Jetpack compose 中为我的图标添加阴影,以便图像和文本具有(大致)相似的阴影。
Text(
text = "HAS SHADOW",
style = MaterialTheme.typography.body2.copy(
shadow = Shadow(
color = Color(0x4c000000),
offset = Offset(2f, 2f),
blurRadius = 7f
)
),
)
Text(
text = "HAS NO SHADOW",
style = MaterialTheme.typography.body2
)
Please note: As you can see above, the icon is partly transparent and i want to keep it that way -> solutions like "Wrap it in a FloatingActionButton" won't work请注意:正如您在上面看到的,该图标是部分透明的,我想保持这种方式 -> 像“将它包装在 FloatingActionButton 中”这样的解决方案将不起作用
Can i do this in compose or do i have to ask my designer to add a shadow?我可以在 compose 中执行此操作,还是必须要求我的设计师添加阴影?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.