This is for graphic design reasons, so height in pixels is preferred. I think different language keyboards may have different heights if that is the case. Then height of USA/UK keyboard would be preferable?
Asked
Active
Viewed 313 times
1
-
1possible duplicate of [What is the height of iPad's onscreen keyboard?](http://stackoverflow.com/questions/4213878/what-is-the-height-of-ipads-onscreen-keyboard) – rebello95 Sep 08 '14 at 08:05
-
The keyboard can have many different shapes on the iPad. http://stackoverflow.com/a/14178620/1329214 – orkoden Sep 08 '14 at 09:09
2 Answers
1
You should get it programatically, it is the best way, register for the notification:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (keyboardDidShow:) name: UIKeyboardDidShowNotification object:nil];
And then get the frame:
-(void) keyboardDidShow: (NSNotification *)notif
{
NSDictionary* info = [notif userInfo];
NSValue *aValue = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
CGRect keyboardFrame = [aValue CGRectValue];
}
Whish it helps!

rptwsthi
- 10,094
- 10
- 68
- 109

David Bemerguy
- 1,334
- 11
- 15
1
You can get height of keyboard, whenever it gets showed:
//add this line to viewDidLoad
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyBordShown name:UIKeyboardDidShowNotification object:nil];
- (void)keyBordShown:NSNotification*)notification
{
NSDictionary* keyboardInfo = [notification userInfo];
NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey];
CGRect keyboardFrameBeginRect = [keyboardFrameBegin CGRectValue];
}
As this will be better approach than statically setting height of keyboard.

rptwsthi
- 10,094
- 10
- 68
- 109