🎛️Picker
SwiftUI ⟩ control ⟩ pickers ⟩ Picker
⭐️ 注意:
PickerStyle.automatic 回傳的是 DefaultPickerStyle,兩者名稱不一致,請小心❗️
👉 SwiftUI Tutorials ⟩ Working with UI Controls ⟩ Sec 3. Define the Profile Editor

VStack(alignment: .leading, spacing: 20) {
Text("Seasonal Photo").bold()
/// ⭐️ Picker
Picker("Seasonal Photo", selection: $profile.seasonalPhoto) {
ForEach(Profile.Season.allCases) { season in
Text(season.rawValue).tag(season)
}
}
.pickerStyle(.segmented)
}SwiftUI ⟩
PickerStyle (protocol)
Last updated
Was this helpful?