@Composable
fun SimpleRectangleBackground() {
Box(
modifier = Modifier
.size(100.dp)
.drawBehind {
drawRect(color = Color.Blue)
drawCircle(color = Color.Red)
val gradient = Brush.verticalGradient(
colors = listOf(Color.Yellow, Color.Magenta)
)
drawRect(brush = gradient)
drawRect(
color = Color.Gray.copy(alpha = 0.5f),
topLeft = Offset(8f, 8f),
size = Size(100f, 100f)
)
}
)
}
Modifier.drawBehind
最新推荐文章于 2024-10-08 14:09:57 发布