2010-11-01 62 views
0

我需要一種強制旋轉方向回到縱向的方式。如何在`willRotateToInterfaceOrientation停止旋轉:`

問題是我有一個標籤欄控制器,但只希望其中一個標籤自動旋轉。

所以我已經允許在所有選項卡上旋轉,現在我需要一種方法來攔截旋轉選項卡上的旋轉位置,我不想旋轉。

我猜我可以在- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration上做到這一點?

感謝 湯姆

回答

0

沒有辦法強迫旋轉。在UITabBarController的情況下,你運氣不好。這是一個關於界面旋轉的全部或全部情況。如果其中一個標籤無法旋轉,則整個UITabBarController保持縱向模式不變。

+0

謝謝。 :)我只需要使我的所有視圖都可以旋轉。 :p – 2010-11-12 11:48:33

0

也許如果所有的viewControllers實現這甚至會工作:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return (return ([[self.tabBarController.selectedViewController class] isSubclassOfClass:[TurnableViewController class]]) || UIInterfaceOrientationIsPortrait(toInterfaceOrientation); 
} 

這將,但是,沒有如果切換回不可轉動回頭視圖,直到你傾斜你的設備..