I have a Picker like this:
Im trying to change the style so it pops up like the keyboard does, see example:
This is my code at the moment:
Picker(selection: $profileViewModel.age, label: Text("Age")) {
ForEach(0 ..< 100) { number in
Text("\(number)")
}
}.pickerStyle(WheelPickerStyle())
Here is a demo of some approach... tested with Xcode 12 / iOS 14
var body: some View {
VStack(spacing: 0) {
Spacer()
Divider()
Picker(selection: $age, label: Text("Age")) {
ForEach(0 ..< 100) { number in
Text("\(number)")
}
}.pickerStyle(WheelPickerStyle())
.frame(maxWidth: .infinity)
.background(Color(UIColor.systemGroupedBackground).edgesIgnoringSafeArea(.bottom))
}
}