I create a set of side by side pickers in an HStack by calling the view below. The "control" area for each picker is much wider to the left of the picker than it should be. ".clipped()" is supposed to fix this, but it is not working. At some point when I was developing the code, it was working, but now I can't get it back. When I try to manipulate the pickers, I can move the rightmost one anywhere on the right 3 columns. The left column cannot be manipulated at all. What is going on here?
struct SinglePickerView: View {
@Binding var note: Int
let notes: [String]
let width: CGFloat
var body: some View {
VStack {
ZStack (alignment: .center) {
RoundedRectangle(cornerRadius: 5)
.fill(Color(red: 192, green: 192, blue: 192))
.frame(width: width-10, height: 25)
Text("\(notes[note])")
.foregroundColor(.black)
}
Picker(selection: $note, label: Text("")) {
ForEach(0 ..< 72) { index in
Text("\(self.notes[index])")
.foregroundColor(.white)
.tag(index)
}
}
.labelsHidden()
.frame(width: width)
.clipped()
}
}
}