1

My question is: how to avoid when the keyboard appears it moves the layout up?

I want to keep it in the same position all the time, as well when the keyboard appears.

In the graphic: Img 1 you can see the view.

In the graphic: Img 2 you can see the problem. The view is moved up.

In the graphic: Img 3 you can see what I want, I want to reduce the size of the view, but not move the entire layout up.

Image description

 var body: some View {
        
        ZStack (alignment: .bottom) {
           VStack {
                FormatView(titulo: “Titel here”) 
                    .overlay(
                        VStack (spacing: 3){
                            Color.clear.frame(height: 44)

                            InPutTextField(dataTextFild: $DatoS.InPutTextField, isTextFildActiv: $DatoS.keyBoardOn, horizontalPadding: 120) // TextFiel view (String, Bool,CGflou)
                            
                          Image(“xImagen”)
                            .resizable()
                            .frame(width: screenSize.maxX - 140, height: 256)
                             .overlay(
                                    Text(“\(DatoS.outPutText)”)
                                )

                                
                            Spacer()
                        }
                    )
                Spacer()
                ZStack (alignment: .bottom){
                    if DatoS.actualView != .homeTwo && actualView != .homeThree {
                        MenuHomeTwo()
                            .frame(width: screenSize.maxX - 40)
                            .offset(y: screenSize.maxY > 738 ? -82 : -62)
                            .transition(.move(edge: .bottom))
                            .animation(.easeInOut)
                    }
                    MenuHomeInferior()
                    
                }
            }
            
            
        } .frame(maxWidth: .infinity, maxHeight: .infinity)
        .background(Color("backgroundColor1”))
         .edgesIgnoringSafeArea(.bottom)
    }
Andrew
  • 26,706
  • 9
  • 85
  • 101
davidnci2
  • 11
  • 2

0 Answers0