可包含控件
Form {
Section(header: Text("Account Info")) {
TextField("Username", text: $username)
SecureField("Password", text: $password)
}
Section(header: Text("Preferences")) {
Toggle("Receive Notifications", isOn: $notificationsEnabled)
Picker("Theme", selection: $selectedTheme) {
Text("Light").tag(0)
Text("Dark").tag(1)
}
Slider(value: $volume, in: 0...100, step: 1)
}
}Last updated