SwiftUI有很多不同的视图组件,包含了Controls容器
Layout容器
Paints容器
Other容器
Button Color Picker Data Picker Disclosure Group
Edit Button Form Group Box Label
Link List Navigation Link Navigation View
Outline Group Picker Progress View Scroll View
Section Secure Field ? Slider
Stepper Tab View Text Text Editor
Text Field Toggle
进行分类
Button 按钮控件
用户需要提供 操作 和 标签 来创建按钮
操作是一个方法或闭包属性,当用户单击或轻触按钮时,它会执行
标签是描述按钮的视图
Button(action : Action){
Content
}
Button(action : {
print("K5")
}){
Text("Button")
}
原文:https://www.cnblogs.com/k5bg/p/14332575.html