I am new to SwiftUI, and I am creating a simple view which contains 3 textfields and a button. When I focus on a textfield the keyboard appears and it moves the view upwards, then when I dismiss the keyboard , the view is moved downwards to its original position, however when this happens a thin line appears then disappears for a fraction of a second.
Any help regarding this matter is really appreciated.
CodePudding user response:
Try using .ignoresSafeArea(.keyboard)
on your view embedding the textfield (not the textfield itself), and let the view take the whole space by adding Spacer()
to the bottom of your view.