Form
主要属性和特性:
Form { Section(header: Text("Account Info")) { // 控件 } }@State private var name: String = ""
示例:
Last updated
Form {
Section(header: Text("Account Info")) {
// 控件
}
}@State private var name: String = ""Last updated
Form {
Section(header: Text("Personal Information")) {
TextField("Name", text: $name)
SecureField("Password", text: $password)
}
Section {
Button("Submit") {
// 提交逻辑
}
}
}