问题
I have a main viewController that is in portrait mode all the time.
I want then to presentModalViewController, but it will come from the left (not from bottom of the screen) in landscape.
Is it possible?
tnx
回答1:
In your modal view controller implementation, override -shouldAutorotateToInterfaceOrientation:
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
回答2:
I came across this problem too. So i just used the modaltransitionstyle so it didn't look to iffy.
Hope this helps.
viewController.modalTransitionStyle = *modaltransitionstyle*;
[self presentModalViewController:viewController animated:YES];
来源:https://stackoverflow.com/questions/1906280/presentmodalviewcontroller-in-landscape-after-portrait-viewcontroller