如何使用Jetpack Compose创建两个圆形

6
我想使用Jetpack Compose来创建这种形状,我该如何做? enter image description here
1个回答

8

您有不同的选项。
其中之一是带有 Icon 的简单的 Box

//external circle
Box( 
    contentAlignment= Alignment.Center,
    modifier = Modifier
        .size(32.dp)
        .border(
            width = 2.dp,
            color = Blue900,
            shape = CircleShape
        ),
){
    //internal circle with icon
    Icon(
        imageVector = Icons.Filled.Check,
        contentDescription = "contentDescription",
        modifier = Modifier
            .size(24.dp)
            .background(Blue900, CircleShape)
            .padding(2.dp),
        tint = Blue200
    )
}

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接