Omar_Radwan01
Omar_Radwan01

Reputation: 1

A thin line appears when the keyboard dismisses - SwiftUI

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.

Upvotes: -1

Views: 125

Answers (1)

el3ankaboot
el3ankaboot

Reputation: 542

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.

Upvotes: 0

Related Questions