Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the iPad keyboard height, when in landscape mode, 1024px?

I ran into this issue earlier in the week and again just now. I'm in the process of setting my keyboard offset for when the keyboard appears on the screen when the user is in landscape mode of an iPad. iPads have a dimension of 1024 x 768.

- (void) keyboardWasShown:(NSNotification *)nsNotification {
    NSDictionary *userInfo = [nsNotification userInfo];
    CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;

    NSLog(@"Height: %f Width: %f", kbSize.height, kbSize.width);
    // Portrait:    Height: 264.000000  Width: 768.000000
    // Landscape:   Height: 1024.000000 Width: 352.000000
}

How is it that the height of the keyboard can be 1024? This would mean that the keyboard is now covering the entire screen. I would assume that the height should be 352, and the width should be 1024. Is this a bug?

like image 871
propstm Avatar asked Dec 21 '12 16:12

propstm


People also ask

How do I get my iPad keyboard back to normal size?

How to make your iPad keyboard full size. Place two fingers on the floating keyboard. Spread your fingers apart to enlarge the keyboard back to full size.

What is iPad floating keyboard?

What Is the Floating Keyboard on an iPad? The floating keyboard is an iPad feature which makes the default virtual keyboard smaller. It floats over the active app, which is why it's called a floating keyboard. You can drag and position it, and it's designed to make it easier to type with one hand.

How do I switch to full keyboard on iPad?

Go to Settings > Accessibility > Keyboards, tap Full Keyboard Access, then turn on Full Keyboard Access. Control your iPad using keyboard shortcuts. To customize the keyboard shortcuts, tap Commands.


1 Answers

From http://developer.apple.com/library/ios/documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html#//apple_ref/doc/uid/TP40006817-CH3-SW27

UIKeyboardFrameBeginUserInfoKey

The key for an NSValue object containing a CGRect that identifies the start frame of the keyboard in screen coordinates. These coordinates do not take into account any rotation factors applied to the window’s contents as a result of interface orientation changes. Thus, you may need to convert the rectangle to window coordinates (using the convertRect:fromWindow: method) or to view coordinates (using the convertRect:fromView: method) before using it.

like image 116
Jonah Avatar answered Sep 29 '22 00:09

Jonah