0

As you can see, the views are not centered because there is a space for Title (which is empty). How can I use it without title to not preserve space for it?

PS I don't want to add offsets for Texts.

enter image description here

Here is the code for the first part of the View:

@State private var selectedHour: Int = 0
private let hours: [Int]

VStack {
    Picker("", selection: $selectedHour) {
        ForEach(hours, id: \.self) {
            Text(String($0))
                .font(Font.openSansLight(withSize: 24))
            }
        }
        .pickerStyle(.wheel)
    }
    Text("h".localized)
        .foregroundColor(mode.underlayBackgroundColor.color)
        .font(Font.openSansLight(withSize: 24))
}
// second part for minutes, the same way. Both VStack
// and Text's are wrapped into HStack of course.
halfer
  • 19,824
  • 17
  • 99
  • 186
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358

0 Answers0