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
Sun, 11.04.2010 14:10
I just solved this simply by o bserving notifications I neede d to track anyway. In my case these were delegate mess [...]
Thu, 01.04.2010 08:43
dj, I haven't checked that situation yet, but I should be able to give it some attentio n shortly. I'll get b [...]
Thu, 01.04.2010 08:40
the scrollView itself is not r esponding to any touches. for example, i added a button on t he scrollview and it doe [...]
Fri, 05.03.2010 23:34
Anya, sorry for not getting back to your earlier. You wil l have to leave some empty spa ce at the sides of your [...]
Sun, 28.02.2010 15:31
Thanks for this great referenc e, there is a little documenta tion about paging in scrollvie w. I have one issue tho [...]