1
在我的RootViewController的shouldAutorotateToInterfaceOrientation方法,我重新实现的方法shouldAutorotateToInterfaceOrientation
这样。IOS开发 - 不要求肖像模式
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
switch (toInterfaceOrientation) {
case UIInterfaceOrientationPortrait:
NSLog(@"Orientation - Portrait");
break;
case UIInterfaceOrientationLandscapeLeft:
NSLog(@"Orientation - Left");
break;
case UIInterfaceOrientationLandscapeRight:
NSLog(@"Orientation - Right");
break;
case UIInterfaceOrientationPortraitUpsideDown:
NSLog(@"Orientation - UpsideDown");
break;
default:
break;
}
return YES;
}
当我旋转我的设备时,此方法为LandscapeRight,LandscapeLeft和UpsideDown调用,但不适用于纵向。
在发起视图处于纵向模式时,这种方法被调用UIInterfaceOrientationPortrait。但是当我旋转设备时,这种方法不仅仅被称为这个方向。
我想旋转在我的主视图中央的UIImageView不旋转的所有接口。 – Steven 2012-10-06 18:37:36