2012-02-14 11 views
2

マスタービューコントローラと詳細ビューコントローラを使用して、UINavigationControllerを作成したいとします。方向が異なるUINavigationコントローラ

Master View ControllerはPortraitとLandscapeRightで回転できますが、Detail View ControllerはLandscapeRightでのみ見ることができます(詳細にはムービーが表示されます)。

これを設定するにはどうすればよいですか?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 

    return interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeRight; 
} 

をして、詳細ビューコントローラトリックを行う必要があります

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 

    return interfaceOrientation == UIInterfaceOrientationLandscapeRight; 
} 

上:

答えて

2

私はあなたのマスター・ビュー・コントローラ上の

コード

の次の行を追加することをお勧めします。 IOSの7

+0

に許容されるのViewControllerを伝えることができます。 – cannyboy

0

、方法

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

は推奨されています。ただし、yes/noを返すには、

- (BOOL)shouldAutorotate 

を使用することができます。

とだけ、それは簡単なことだったら、あなたは、向きがなんてこったああ

- (NSUInteger)supportedInterfaceOrientations 
関連する問題