Implement the following method, which should be called when the view is pushed onto the navigation stack:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
This should automatically rotate everything sideways as soon as you push it on to the stack, since the view does not support portrait orientations.
If I'm wrong and it doesn't, you can always force horizontal orientation by setting the status bar orientation:
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:animated];
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…