On iPad, after subscribing to UIKeyboardDidShowNotification
NSDictionary* info = [aNotification userInfo];
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
NSLog(@"%@", NSStringFromCGSize(kbSize));
prints {352, 1024}
Isn’t this wrong? Not only is height of keyboard so large, how can height be larger than width?
Or am i missing something?
I bet the dimensions are reported in a static orientation (the ‘window’ orientation never actually changes), so I suggest translating that to your view of interest. My normal trick is to convert it to the coordinate space of the window’s rootViewController’s view:
Or a more appropriate view if you have one available. The key is that any coordinates reported in the window’s coordinate space are not rotated, even if the window’s rootVC’s view is.