This is my first post, I think by sheer bumbling I found a way to get multiple pickers in a single view without the touch targets overlapping in XCode 13.2.1, IOS 15.2. I was unable to get it to work with various iterations of .clipped(), .compositingGroup() as discussed in the thread above, but did get it to work with embedding the Picker inside a horizontal ScrollView. In my example below, I also embedded the ScrollView in a Group so I could center the wheel of the ScrollView and keep its vertical dimensions tight, so the parent Starting Census View has a ListView, each child with 3 horizontally adjacent Picker views, all able to be turned independently and without landing on adjacent pickers' target areas. Holding my breath that this is not broken in a future OS 15 update.
struct DigitDialView: View {
@Binding var currentValue: Int
var minValue = 0
var maxValue = 20
var body: some View {
Group {
ScrollView {
Picker("census",selection: $currentValue){
ForEach(minValue..<maxValue){value in
Text("\(value)").tag(value)
}
}
.pickerStyle(.wheel)
.frame(width: 40)
}
.frame(height: 215)
}
.frame(height: 45)
.clipped()
}
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: