Created
August 13, 2014 14:47
-
-
Save onmyway133/66d13674785cce401794 to your computer and use it in GitHub Desktop.
Keyboard frame convert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/9746417/keyboard-willshow-and-willhide-vs-rotation/14351009#14351009 | |
- (void) keyboardWillShow:(NSNotification *)aNotification | |
{ | |
CGRect keyboardFrame = [[[aNotification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; | |
CGRect convertedFrame = [self.view convertRect:keyboardFrame fromView:self.view.window]; | |
...... | |
/* Do whatever you want now with the new frame. | |
* The width and height will actually be correct now | |
*/ | |
...... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment