How to move the iPhone keyboard down like in Messages.app?

Possible duplicate:
IMessage Receding Keyboard in iOS app

In the iOS5 Messages app, you can slide your finger across the keyboard to slide it up and down. This is also done in the iA Writer app in the AppStore. How can I do this in code, i.e. access and change the Y-position of a UIKeyboard?

+6
source share
2 answers
+9
source

There is no way to do this, but you can change the keyboard frame as follows:

UIWindow* tempWindow; //Because we cant get access to the UIKeyboard throught the SDK we will just use UIView. //UIKeyboard is a subclass of UIView anyways UIView* keyboard; //Check each window in our application for(int c = 0; c < [[[UIApplication sharedApplication] windows] count]; c ++) { //Get a reference of the current window tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:c]; //Get a reference of the current view for(int i = 0; i < [tempWindow.subviews count]; i++) { keyboard = [tempWindow.subviews objectAtIndex:i]; if([[keyboard description] hasPrefix:@"(lessThen)UIKeyboard"] == YES) { //If we get to this point, then our UIView "keyboard" is referencing our keyboard. } } } 
+2
source

All Articles