Why is the registration field always pushed down a bit?
//
// LoginView.swift
// Database
//
// Created by Maxi on 25.03.24.
//
import SwiftUI
struct LoginView: View {
@State var email = ""
@State var password = ""
var body: some View {
NavigationView {
VStack {
//Header
HeaderView()
//Login Form
Form{
TextField("E-Mail Adresse", text: $email)
.textFieldStyle(DefaultTextFieldStyle())
SecureField("Passwort", text: $password)
.textFieldStyle(DefaultTextFieldStyle())
CreateAccountButton(
title: "Anmelden",
background: .blue) {
//Attempt log in
}
.padding()
}
//Create ACC
VStack {
Text ("Neu hier?")
//Show registartion
NavigationLink ("Erstelle einen Account",
destination: RegisterView())
}
.padding(.bottom, 0)
}
}
}
}
struct LoginView_Previews: PreviewProvider{
static var previews: some View {
LoginView()
}
```//
// HeaderView.swift
// Database
//
// Created by Maxi on 25.03.24.
//
import SwiftUI
struct HeaderView: View {
var body: some View {
VStack {
HStack {
Text("Anmeldung")
.font(.title)
.fontWeight(.bold)
Spacer()
HStack {
Image (systemName: "questionmark")
Image (systemName: "gear")
}
.font(.title)
}
.padding()
}```