gpt4 book ai didi

android - 如何使用 Jetpack Compose 创建圆角边框按钮

转载 作者:行者123 更新时间:2023-12-03 18:14:17 29 4
gpt4 key购买 nike

我需要使用 Jetpack Compose 在 Button 中添加圆角边框

喜欢 :

enter image description here

最佳答案

要实现带有圆角边框的按钮,您可以使用 OutlinedButton 中应用的组件shape 参数a RoundedCornerShape :

OutlinedButton(
onClick = { },
border = BorderStroke(1.dp, Color.Red),
shape = RoundedCornerShape(50), // = 50% percent
// or shape = CircleShape
colors = ButtonDefaults.outlinedButtonColors(contentColor = Color.Red)
){
Text( text = "Save" )
}
enter image description here

关于android - 如何使用 Jetpack Compose 创建圆角边框按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58875567/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com