在使用 SwiftUI 时,我在将我的“twitter”图像放在我的视图中时遇到问题。我想让 twitter 图像更接近我的两个 blob 图像,并在 twitter 图像和“登录我的帐户”短语之间添加间距。此外,我正在尝试获取我的 UITextfield,我想现在它只是 TextField 在我的“登录您的帐户短语”下方单击时出现在键盘上,但这现在显示在我的视图中。
GeometryReader { (deviceSize: GeometryProxy) in
ZStack {
//Define a screen color
LinearGradient (gradient: Gradient(colors:[Color(ColorsSaved.gitLabDark),Color(ColorsSaved.gitLabLight)]),startPoint: .leading,endPoint: .trailing)
//Extend the screen to all edges
.edgesIgnoringSafeArea(.all)
Image("blobVectorLight")
.resizable()
.frame(width: deviceSize.size.height * (220/812) * 0.81, height: deviceSize.size.height * (220/812), alignment: .topTrailing)
.frame(width: deviceSize.size.width, height:deviceSize.size.height , alignment: .topTrailing)
.edgesIgnoringSafeArea(.all)
Image("blobVectorDark")
.resizable()
.frame(width: deviceSize.size.height * (208/812) * 0.74, height: deviceSize.size.height * (208/812), alignment: .topTrailing)
// .overlay(Image("blobVectorLight"))
.frame(width: deviceSize.size.width, height:deviceSize.size.height , alignment: .topTrailing)
.edgesIgnoringSafeArea(.all)
VStack{
Image ("twitter")
.resizable()
.frame(width: deviceSize.size.height*(77/812)*2.078, height: deviceSize.size.height*(77/812))
Text ("Sign into your account")
.foregroundColor(.white)
TextField ("Username")
}
}
}
}
}