1

それぞれルート ビュー コントローラーを持ついくつかのナビゲーション コントローラーを含むタブ バー ビュー コントローラーがあります。すべて縦向きでのみレンダリングする必要があります。すべて順調です。子ビュー コントローラーの 1 つは、そのナビゲーション vc を使用して別のビュー コントローラーをプッシュします。

Tabbar vc
   nav vc/vc1
   nav vc/vc2
   nav vc/vc3
      pushes new vc4   <- ONLY this one should autorotate. Further more, if you're in landscape mode in this vc and hit 'back', it goes back in portrait.

アプリの「ライン」がこれを行います - 実際の「チャット」ウィンドウは自動回転できます。

コードを教えてください!;) 変換をいじる必要がないことを願っています...

4

2 に答える 2

1

UITabBarController アプリケーションで自動回転をサポートするには、tabBarController でビュー コントローラーの回転呼び出しをサブクラス化し、現在表示されているビュー コントローラーが新しい向きをサポートしているかどうかを確認する必要があります。特定のケースでは、vc4 は向きの変更をサポートしているかどうかを尋ねられるため、尋ねられたときにタブバーを回転させることができます。

この質問を見てください:横向きモードの tabBarController と navigationControllers、エピソード II

于 2012-11-14T16:13:55.957 に答える
0

@Colin ur Tabbar viewcontrollerでは、次のようなポートレイトに制限します

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

そして、あなたの新しいviewcontroller(vc4)では、それを横向きに制限します。

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

それが役に立てば幸い。

于 2012-11-14T16:23:33.490 に答える