zaniluca / SwiftUISnackbar

A simple Snackbar view extension for your SwiftUI application
MIT License
33 stars 4 forks source link

Padding problem #4

Closed fatihdurmaz closed 1 year ago

fatihdurmaz commented 1 year ago

// // LoginView.swift // ToDoList // // Created by Fatih Durmaz on 5.05.2023. //

import SwiftUI

struct LoginView: View { @StateObject var viewModel = LoginViewModel()

var body: some View {
    NavigationView {
        VStack {
            //Header
            HeaderView(title: "To Do List", subTitle: "Get things done", angle: 15, background: .pink)

            // Login Form
            Form {
                TextField("Email Address", text: $viewModel.email)
                    .textFieldStyle(DefaultTextFieldStyle())
                    .autocapitalization(.none)

                SecureField("Password", text: $viewModel.password)
                    .textFieldStyle(DefaultTextFieldStyle())

                TLButton(title: "Log In", background: .blue) {
                    print("aas")
                    viewModel.login()
                }
                .padding()
            }
            .offset(y:-50)

            VStack {
                Text("New around here?")
                NavigationLink("Create An Account", destination: RegisterView())
            }
            .padding(.bottom, 50)
            .snackbar(isShowing: $viewModel.showError, title: "Error", text: viewModel.errorMessage, style: .warning)

        }
    }
}

}

Ekran Resmi 2023-05-10 14 51 32 Ekran Resmi 2023-05-10 14 51 44

Elements slide up due to padding. How can I fix.