如果项目中用了navigationViewController, 那么就应该新建一个uinavigationViewController的子类,然后在这个类里面写上下面的代码,在使用的时候就用自定义的这个navCtr, 就是说需要在根视图里面控制
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
- {
- return toInterfaceOrientation != UIDeviceOrientationPortraitUpsideDown;
- }
-
- - (BOOL)shouldAutorotate
- {
- if ([self.topViewController isKindOfClass:[AddMovieViewController class]]) {
- return YES;
- }
- return NO;
- }
-
- - (NSUInteger)supportedInterfaceOrientations
- {
- return UIInterfaceOrientationMaskAllButUpsideDown;
- }
单个ViewController支持横屏,其他全竖屏方法-b
原文:http://www.cnblogs.com/isItOk/p/5610599.html