I'm trying to create an input similar like this (⬇) with SwiftUI
.
I've made progress but I can't figure out how to change the height of the text fields and make the input text size bigger.
You can change text size by changing the placeholder text's font size, which automatically adjusts the TextField
's height.
In your case, this looks pretty similar to what you asked for:
HStack {
Group {
TextField($str, placeholder: Text("A"))
TextField($str, placeholder: Text("B"))
TextField($str, placeholder: Text("C"))
TextField($str, placeholder: Text("D"))
}
.frame(width: 60, height: nil)
.padding(.all, 5)
.textFieldStyle(.roundedBorder)
.font(Font.system(size: 60, design: .default))
.multilineTextAlignment(.center)
}