I’ve been wondering if it is possible to replicate the behavior of Apple’s iOS5 keyboard in the messages app, without using any private API calls. When you scroll down past the keyboard in the messages app, the keyboard will collapse leaving more room to see messages – try it to see.
I couldn’t find anything that points towards making this without having to start jumping through some serious hoops to get an instance of the Keyboard’s View. And I’m pretty sure Apple wouldn’t be happy with that.
In addition to the answer given below you can see a fully baked xcode project of my implementation here:
https://github.com/orta/iMessage-Style-Receding-Keyboard
This is an incomplete solution, however it should give you a good starting point.
Add the following ivars to your UIViewController:
Add an inputAccessoryView to your text controller. I created an small view to insert as the accessoryView:
I added the above code to
-(void)loadViewRegister to receive UIKeyboardDidShowNotification and UIKeyboardDidHideNotification when view is loaded:
Add methods to specified as the selectors for the notifications:
Add methods to track touched and update keyboard view:
Disclaimers:
The SlidingKeyboard project I created to test this concept is available from GitHub in the examples directory of BindleKit:
https://github.com/bindle/BindleKit
Edit: Updating example to address first disclaimer.