UI常用控件属性:
1.Text:类似oc中的Label控件
Text("Hello, world!")
.padding()
.font(.system(size: 12.0))
.foregroundColor(.orange)
.overlay(
RoundedRectangle.init(cornerRadius: 25.0)
.stroke()
)
2.Button:
Button(action: {
print("点击了按钮")
}, label: {
Text("我是按钮")
.padding()
.foregroundColor(.red)
})
3.Spacer:展位控件