I created a segment picker for select gender in that segment picker I have to option one for Male and another for Female. Picker is working fine But set title on with picker it’s not showing. I set title Select Gender which is not showing as a title on the Picker.
struct ManagerChildrenView: View {
//MARK: Properties
@State var selectedGender = 0
let genders = ["Male", "Female"]
var body: some View {
Form{
Section{
Picker("Select Gender", selection: $selectedGender) {
ForEach(0..<genders.count) { index in
Text(self.genders[index]).tag(index).font(.title)
}
}.pickerStyle(SegmentedPickerStyle())
}
}
}
}
Screenshot:
SegmentedPickerStyle
does not show the title. You need to create a custom title for it. – Yulan