0

重複の可能性:
iOS 6 の向きの方法

iOS 6 で向きの方法が変更されました。ポートレート モードのアプリ全体が多くのビュー コントローラー (タブ バー ビュー コントローラーではありません) を取得しました。回転時にビュー コントローラーの 1 つをランドスケープ モード (実際には webView が表示されます) に回転させたいだけです。以下のメソッドは 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 に答える