One nifty little
iPhone feature that left an impression with me is the way that the keyboard in the "
Messages" application slides in and out with the keyboard, as if it were attached to it - but it isn't. I needed a similar feature for an app that I'm currently working on for a client, so I decided to investigate how to implement this feature in my own stuff.
Although my first instinct was to simply use an implicit animation using
UIView's
+beginAnimations:context: method, I decided to quickly search the web for some information on how other developers approached this problem.
The results were a little surprising, possibly because the proper way to do it wasn't as easily available before iPhone OS 3.0 - various people on different message boards and mailing lists suggested a hack that involved looping through all instances of
UIWindow to find the one containing an instance of
UIKeyboard, a private class that isn't even documented in the iPhone SDK. Those hacks then proceeded to modify the dimensions of the view that contains the keyboard and adding the
UIToolbar instance as a subview, so it would animate into the key window right along with the keyboard.
Needless to say, these hacks are not exactly future-proof or what I would consider a proper implementation of this feature. The
Core Animation route was the one to go, so I proceeded in that direction.
More about this after the jump.
Read More
Latest Comments
Thu, 05.05.2011 21:12
Very kind of you to share this , Alexander. A couple of minor corrections, if I may: In your addObservers:... me [...]
Mon, 02.05.2011 01:15
blog.proculo.de site is cool . Bookmarked !!! [url=http ://betonufc.info]ufc betting[/ url]
Tue, 05.04.2011 21:10
You may find it interesting to note that I have now decided to return the Android phone I bought and go back to an [...]
Tue, 05.04.2011 18:10
I have an Android device and f or me, it's not the UX of the OS that's the problem. Thanks to the dedicated keys, a [...]
Tue, 05.04.2011 17:41
Matthew, note that I never said Mark shouldn't have switc hed to an Android phone. If th at is his choice, and he [...]