AutoLayout constrain for a view to be right above the keyboard

160 views Asked by At

Would someone be so kind telling me how would you set a constrain (using size classes) for a view to be right above the keyboard (without the predictive part) on iP6 and iP6+ like on the photo below?

May I have a sample project?

Thank you

ios

layout

2

There are 2 answers

1
shim On BEST ANSWER

Either add the constraints in programmatically based on the keyboard size, or make separate interface files for every screen size with a fixed constraint based on a known size for the keyboard for that screen.

1
Alec. On

Below is a link to a chat application that works from the same premise. When the keyboard is active elements are pushed up so they aren't hidden by it.

https://github.com/oseparovic/MessageComposerView

The application is in Objective C and pretty easy to transfer that section of the app, I've used this myself.