0

I'm very new to SwiftUI and iOS development. There is a margin (red circle in the picture) on the top of the picker that I'm trying to remove by applying equal spacing between the picker and the button. Is there any parameter that can automatically add spacing between items to fit the height of VStack?

VStack() {
    if self.timerManager.timerMode == .initial {
        Picker(selection: $repPickerIndex, label: EmptyView()) {
            ForEach(0 ..< repCounts.count) {
                Text("\(self.repCounts[$0]) reps")
            }
        }.frame(width: .infinity, height: .infinity)
        
        Button(action: {
            self.timerManager.setRepcount(repCountSelected: self.repCounts[self.repPickerIndex])
            self.timerManager.exercise()
        }) {
            Text("Start")
        }
    }
}

enter image description here

Ryuji
  • 113
  • 2
  • 8

0 Answers0