-1

So i want my keyboard to overlay the view so that the view stays and not going upwards. i did several variations such as adding it in my loginstuff, or adding in it navigationView. it doesn't work at all

Here's my code

struct LoginView: View {
    @StateObject var userData = UserData()
    var body: some View {
        NavigationView {
            ZStack(alignment:.top) {
                Color.pink.ignoresSafeArea(edges: .top)
                VStack {
                    Image(systemName: "graduationcap.fill")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/, height: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
                        .foregroundColor(.white)
                        .padding(.top,30)
                    Text("Study +")
                        .font(.title)
                        .fontWeight(.medium)
                        .foregroundColor(.white)
                    Spacer()
                    //Mark : The login Thinggy
                    LoginStuffs()
                }
            }
            .edgesIgnoringSafeArea(.bottom)
            .navigationTitle("Login")
            .navigationBarHidden(true)
        }
    }
}

Login Stuff

struct LoginStuffs: View {
    @State var username:String = ""
    @State var password:String = ""
    @State var isShow:Bool = false
    var body: some View {
       Vstack{
Textfield()
Securefield()
Securefield()
        }
        .padding()
        .frame(width:UIScreen.width,height:UIScreen.height/1.5)
        .background(Color.white)
        .cornerRadius(15, corners: [.topLeft, .topRight])
        //.ignoresSafeArea(edges: /*@START_MENU_TOKEN@*/.bottom/*@END_MENU_TOKEN@*/)
    }
}

Seems like there's a problem within my codes in which I did not know (probably due to not learn it properly). please do help, thank you for your attention The Problem

Farhandika
  • 437
  • 1
  • 3
  • 16

1 Answers1

0

use on your NavigationView

.edgesIgnoringSafeArea(.bottom))
rsergiu2003
  • 102
  • 3