Swift 5, Xcode 10
The layout of my UIViewController
:
I use this code to push the Server Text Field
up when the keyboard is opened.
At first it pushed the bottom UIStackView
into the top one, so I added the Server Stack View.top >= Username Stack View.bottom + 20
constraint and now it's keeping a proper distance.
BUT now it also automatically decreases the height of the Server Text Field
when it's pushed up. Giving the Server Stack View
a fixed height of 60.5 smushes the "Login" button, so I set the height of the Username Stack View
to a fixed 110.5, which didn't change anything.
I tried changing the Vertical Content Compression Resistance Priority
of multiple UI elements to 999 but there's always one UI element whose height is decreased.
As you can see in this screenshot, there's enough space above the keyboard:
How can I make auto layout use this space instead of "smushing" UI elements?
Edit:
I found out what this additional space is: It's the height of the "version" label and its constraint (30pts to the bottom of the screen in my case). Unfortunately I haven't been able to get rid of this yet - apart from removing the label, which still doesn't stop the "smushing".