【发布时间】:2020-12-08 15:41:32
【问题描述】:
我想创建一个带有圆角矩形视图的按钮,带有边框和背景颜色。
到目前为止我写了这个:
Button(action: {
}, label: {
Text("TAP ME")
.foregroundColor(Color.blue)
})
.frame(height: 50)
.frame(maxWidth: .infinity)
.overlay(
RoundedRectangle(cornerRadius: 50, style: .continuous)
.strokeBorder(Color.blue, lineWidth: 1)
)
我尝试在许多不同的地方添加.background(Color.red),但这是我每次都得到的:
在这里做什么?
感谢您的帮助
【问题讨论】: