A thin line appears when the keyboard dismisses - SwiftUI

93 views Asked by At

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.

1

There are 1 answers

0
el3ankaboot On BEST ANSWER

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.