I want to put two pickers in one line. And I used two guidelines (https://www.hackingwithswift.com/forums/swiftui/custom-multicomponent-picker-pure-swiftui/2236 and https://blckbirds.com/post/swiftui-how-to-create-a-multi-component-picker/)
my code:
import SwiftUI
struct Adding: View {
// my var’s
var body: some View {
GeometryReader { geometry in
Form{
// my other code
() {
Toggle(isOn: $time) {
Text("Set a remind time")
}
if (time){
HStack(spacing:0){
Picker("", selection: $minutes) {
ForEach(min, id: \.self) {
Text("\($0)").tag($0)
}
}.pickerStyle(WheelPickerStyle())
.labelsHidden()
.frame(width: geometry.size.width/2)
.clipped(antialiased: false)
Picker("", selection: $hours) {
ForEach(hr, id: \.self) {
Text("\($0)").tag($0)
}
}.pickerStyle(WheelPickerStyle())
.labelsHidden()
.frame(width: geometry.size.width/2)
.clipped()
}
}
}
}
But the active area doesn’t changes(like without .clipped() , but design changes)
What I’m doing wrong?
IDE: swift playgrounds (v. 4.1) Device: IPad (9-th gen) OS : IPadOS 15.5 (19F77)