I am upgrading a legacy app to iOS 6, which only supports landscape orientation. When I run the app in the iPhone simulator or on my iPhone 4, the orientation of the root view controller is in portrait mode when it is supposed to be in landscape right. The keyboard is in the correct position initially, however. In addition, when I rotate the device, the keyboard sticks to its initial orientation, and the root view never changes orientation.
In the Supported Interface Orientations section of the project settings, the Landscape Left and Landscape Right buttons are selected. In the pList file, Landscape (right home button) is set for Initial Interface Orientation, and Landscape (right home button) and Landscape (left home button) are set for Supported interface orientations.
Also, in the root view controller, I have replaced this code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
BOOL rotate = NO;
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
rotate = YES;
return rotate;
}
With this code:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotate {
return YES;
}
Any ideas?