我看到按钮上有两个边框,它看起来很奇怪.我try 创建的形状与圆形矩形叠加,并得到相同的结果.这是我使用的代码:
ScrollView(.horizontal, showsIndicators: false) {
HStack {
Button(action:{ action()}) {
Label("Name", image: "info")
}
.frame(height: 40)
.padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
.foregroundColor(.green)
.background(.clear)
.overlay(
Capsule(style: .continuous)
.stroke(.green, lineWidth: 1)
)}}