Fix keyboard setting in iPad landscape app (keyboard inverted)
I am converting an iPhone app (UIInterfaceOrientationLandscapeRight) as a generic app. So far I have the correct orientation: the iPad version will launch with the correct splash pattern and will start in the correct orientation (LandscapeLeft or LandscapeRight) depending on how the user is holding it.
But: when I launch the keyboard when the iPad is in LandscapeLeft, the keyboard is displayed upside down:
I cannot post images, so you can see the error here: http://blog.durdle.com/images/ipad_keyboard.png
That UIAlertView with UITextField added to it. I am assuming the keyboard is currently in the LandscapeRight orientation.
If I rotate the device to LandscapeRight, the game view rotates to match the keyboard, and then if I rotate the device back to LandscapeLeft, the whole interface - the game AND the keyboard rotates together to display correctly.
So: how can I make sure it displays in the correct orientation?
a source to share
Unfortunately. Boy, I feel stupid.
I left this code in the method that opens my UIAlertView:
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
It was a break from the original iPhone app when I needed to force the keyboard orientation in OS 2.2.1. Now it is completely unnecessary! Removing the issue fixed the problem.
a source to share