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.
您可以通过更改占位符文本的字体大小来更改文本大小,该占位符文本会自动调整TextField的高度。
在您的情况下,这看起来与您要求的内容非常相似:
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)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1397 次 |
| 最近记录: |