Possible Duplicate:
iMessage Style Receding Keyboard in an iOS App
In the iOS5 Messages app, you can slide your finger down on the keyboard to bring it up and down. This is also done in the iA Writer app in the AppStore. How can I do this in code, that is, access and modify the Y position of the UIKeyboard?
Touch and hold the keyboard button in the lower-right corner of the keyboard. Slide your finger up to either Merge or Dock and Merge, then let go.
Assign an alternative layout to a keyboardGo to Settings > General > Keyboard > Keyboards. Tap a language at the top of the screen, then select an alternative layout from the list.
Why reinvent the wheel? There are several open-source projects available that mimick the messages.app receding keyboard:
http://cocoacontrols.com/platforms/ios/controls/madismissivetextview
http://cocoacontrols.com/platforms/ios/controls/dakeyboardcontrol
http://cocoacontrols.com/platforms/ios/controls/imessagekeyboardeffect
To name a few.
There is no method to do this, but you may be able to modify the keyboard's frame directly like this:
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.
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With