在 iPhone 设计中看起来不错。但在 iPad 中,TextField
宽度并没有增加。如果我更改内容模式以填充两个字段是重叠的。我怎样才能解决这个问题?
var body: some View {
VStack (alignment: .center,spacing :35){
TextField("Enter Username", text: $username).frame(minWidth: 0 , maxWidth: .infinity).frame(height: 55).background(Image("userinput").resizable().aspectRatio(contentMode: .fit)).multilineTextAlignment(.center).padding([.leading,.trailing],15)
TextField("Enter Password", text: $username).frame(minWidth: 0 , maxWidth: .infinity).frame(height: 55).background(Image("pswrd").resizable().aspectRatio(contentMode: .fit)).multilineTextAlignment(.center).padding([.leading,.trailing],15)
Button("SIGN IN") {
action = true
print("Just tapped")
}.frame(minWidth: 0 , maxWidth: .infinity).frame(height: 55).background(Color(red: 46/255, green: 152/255, blue: 182/255)).foregroundColor(.white).cornerRadius(5).padding([.leading,.trailing],50)
}
}