I am trying to go from a viewcontroller that supports landscape (while in landscape mode), to one that explicitly doesn't (and shouldn't) support landscape. I'm doing this as follows:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
Ideally I want the new viewController that i'm pushing onto the stack to start off initially in portrait, not landscape. Strangely even with this method implemented, it starts off in Landscape.
My only guess is that Apple doesn't want a user transitioning from landscape to portrait (despite allowing us to go from landscape, back to a previous controller that is in portrait).
Any insights and/or help would be much appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…