Android Studio 有没有办法在jetpack compose中制作填充+圆形图标?

xe55xuns  于 2022-11-16  发布在  Android
关注(0)|答案(1)|浏览(146)

我只是想问一下,在Android Studio中是否有任何方法可以同时使图标圆形和填充或圆形和轮廓。因为,我更喜欢圆形图标,但如果我添加圆形图标,我无法使其轮廓。我也不想导入svg。谢谢您的回答!

q7solyqu

q7solyqu1#

OutlinedButton(
    onClick = { Toast.makeText(mContext, "This is a Circular Button with a Icon", Toast.LENGTH_LONG).show() },
    modifier = Modifier.size(100.dp),
    shape = CircleShape,
    border = BorderStroke(5.dp, Color(0XFF0F9D58)),
    contentPadding = PaddingValues(0.dp),
    colors = ButtonDefaults.outlinedButtonColors(contentColor = Color.Blue)
) {
    // Adding an Icon "Add" inside the Button
    Icon(Icons.Default.Add, contentDescription = "content description", tint = Color(0XFF0F9D58))
}

here中的更多内容...

相关问题