Skip to content

Instantly share code, notes, and snippets.

@RosayGaspard
Last active January 27, 2020 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RosayGaspard/03ac8a80ef8244f2905648c5bfac668f to your computer and use it in GitHub Desktop.
Save RosayGaspard/03ac8a80ef8244f2905648c5bfac668f to your computer and use it in GitHub Desktop.
struct LoginView: View {
@State private var username: String = ""
@State private var password: String = ""
var body: some View {
GeometryReader { geometry in
VStack{
Image("lock")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height:(geometry.size.height / 3) )
.clipped()
.padding(.bottom, 50)
TextField("Username...", text: self.$username)
.frame(width: geometry.size.height - 50, height: 30)
.foregroundColor(.black)
.multilineTextAlignment(.center)
.padding()
.background(Color(red: 239.0/255.0, green: 243.0/255.0, blue: 244.0/255.0, opacity: 1.0))
.cornerRadius(5.0)
SecureField("Password...", text: self.$password)
.frame(width: geometry.size.height - 50, height: 30)
.foregroundColor(.black)
.multilineTextAlignment(.center)
.padding()
.background(Color(red: 239.0/255.0, green: 243.0/255.0, blue: 244.0/255.0, opacity: 1.0))
.cornerRadius(5.0)
Spacer()
.frame(height: 20)
Button(action: {})
{
Text("Connect!")
}
.foregroundColor(.white)
.padding()
.frame(width: 250, height: 60)
.background(Color(red: 67/255, green: 110/255, blue: 79/255, opacity: 1.0))
.cornerRadius(15.0)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment