The UI i want to build
Hi Team,
I am trying to build UI as attached in the Snapshot.
The Problem is inner small rectangle (With LOGIN Text), am unable to place at top of outer rectangle.
The Problematic UI
Code:
import SwiftUI
struct LoginView: View {
@State private var email: String = “”
@State private var password: String = “”
var body: some View {
ZStack{
VStack(){
Spacer()
Text(“LOGO”).bold()
Spacer()
ZStack{
Rectangle()
.foregroundColor(.white)
.cornerRadius(10)
.shadow(radius: 5)
.aspectRatio(CGSize(width: 235, height: 300), contentMode: .fit)
Rectangle()
.foregroundColor(.black)
.cornerRadius(10)
.shadow(radius: 5)
.aspectRatio(CGSize(width: 235, height: 50), contentMode: .fit)
Text("LOGIN").font(.headline).fontWeight(.heavy).foregroundColor(Color.white).multilineTextAlignment(.center)
.position(x: 185, y: 154)
VStack{
TextField("Email", text: $email)
TextField("Password", text: $password)
}
}
Text("Don't have an accout? SignUP")
Spacer()
}
}
.padding(30)
}
}
Please help.
Thanks