iPad orientation on launch problem in portrait (bottom home button)
I've an iPad app that supports all orientation... my problem was on the start up of the application. In case of landScapeRight and landScapeLeft and portrait(top home button) the views shows correctly but when the app start in portrait (bottom home button) the views show in landscape mode... I've implemented the
- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
- (BOOL)shouldAutorotateToInterfac开发者_如何学GoeOrientation:(UIInterfaceOrientation)interfaceOrientation
When I change the apps orientation the views shows correctly.
I've run into this problem as well. After digging around https://devforums.apple.com it appears this may be a bug. There is a work-around that someone recommended and that worked for me.
Step 1. In XCode4 (or via the Info.plist file) limit the supported orientations to just UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight
Step 2. Still return YES for all interface orientations via:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
This will have the result of starting your app in landscape mode, but allowing the user to rotate it to any mode they want while its running. This will correct the rendering issue you have.
A similar question/answer can be found here: Landscape Mode ONLY for iPhone or iPad
精彩评论