0

可能重复:
ios 6 定位方法

iOS 6 中的方向方法发生了变化。我在纵向模式下的整个应用程序有许多视图控制器(不是标签栏视图控制器)我只想在我旋转时将我的视图控制器之一旋转到横向模式(它实际上显示一个 webView) device.the 下面的方法在 xcode 4.4 中工作,但它不在 Xcode.4.5 中

         - (BOOL)shouldAutorotateToInterfaceOrientation:
       (UIInterfaceOrientation)interfaceOrientation {
       return (interfaceOrientation == UIInterfaceOrientationPortrait ||
       interfaceOrientation == UIInterfaceOrientationLandscapeLeft || 
    interfaceOrientation == UIInterfaceOrientationLandscapeRight );

上述方法在 xcode 4.5 中不起作用,因此我更改了以下方法,但即使它不起作用....请提供任何建议,谢谢。

    - (BOOL) shouldAutorotate{
     [[UIApplication sharedApplication] setStatusBarOrientation:                        UIInterfaceOrientationPortrait];
    return self.modalViewController.shouldAutorotate;
     }  
     -(NSUInteger)supportedInterfaceOrientations
       {
         return UIInterfaceOrientationMaskLandscape;
          }
4

1 回答 1

0

您是否也在实施supportedInterfaceOrientations?你可能想要。

于 2013-02-02T22:14:25.340 回答