Created
July 24, 2020 14:53
-
-
Save amosgyamfi/6a088e50a66149e9568480b60604b905 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// textfield | |
// | |
// Created by Amos Gyamfi on 24.7.2020. | |
// | |
import SwiftUI | |
struct ContentView: View { | |
@State private var fieldPlaceholder = "" | |
let screenFrame = LinearGradient(gradient: Gradient(colors: [Color(#colorLiteral(red: 0.4620226622, green: 0.8382837176, blue: 1, alpha: 1)), Color(#colorLiteral(red: 0.476841867, green: 0.5048075914, blue: 1, alpha: 1))]), startPoint: /*@START_MENU_TOKEN@*/.leading/*@END_MENU_TOKEN@*/, endPoint: .bottomTrailing) | |
var body: some View { | |
ZStack { | |
screenFrame | |
.edgesIgnoringSafeArea(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/) | |
VStack(alignment: .leading) { | |
Text("Email") | |
.font(.caption) | |
TextField("[email protected]", text: $fieldPlaceholder) | |
.font(.caption2) | |
.textFieldStyle(RoundedBorderTextFieldStyle()) | |
.frame(width: 300, height: 46, alignment: .leading) | |
.foregroundColor(Color(.systemGray)) | |
} | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment