I want to handle keyboard notifications to move textfield up and down on tap of it in portrait as well as landscape ..how to get the height of keyboard in portrait and landscape to achieve this?
how to get keyboard height for portrait and landscape in IPhone and IPad
1.9k views Asked by puneetha koopadira At
2
There are 2 answers
1
On
use this code
- (void)keyboardWillShow:(NSNotification*)note {
NSDictionary* info = [note userInfo];
CGSize _kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
float kbHeight = _kbSize.width > _kbSize.height ? _kbSize.height : _kbSize.width;
}
it will work in all the cases. Let me know if it works.
You can find Height of keyboard using following code.