1

我有一個標籤欄控制器,帶有4個導航控制器連接4標籤欄項目。帶有導航控制器的標籤欄每個標籤項目 - 方向問題

我提出在以下控制器

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return YES; 
} 
  1. 所有視圖控制器進行以下更改。
  2. 所有導航控制器。
  3. 1個tabbar控制器。

還有什麼要解決這個問題?

[再重新發布!]

+0

你看到了什麼問題?並且您不需要在UINavigationController中重寫'shouldAutorotateToInterfaceOrientation:'。 – 2010-07-03 13:20:34

+0

我也嘗試過。但沒有效果! – thndrkiss 2010-07-03 13:35:25

回答

2

OK,看到你的問題仍然一天後無人接聽,我會盡量回答它,即使你沒有真正解釋的問題是什麼。

提供自動旋轉在標籤欄的應用程序,你需要實現shouldAutorotateToInterfaceOrientation:在:

  1. 所有視圖控制器
  2. 你的標籤欄控制器

需要子類UINavigationController,只需UITabBarController

當您完成UITabBarController的子類化後,請確保在Interface Builder中將標籤欄控制器實例的類設置爲您的子類。

另外,對於iPhone應用程序的正確執行shouldAutorotateToInterfaceOrientation:是:

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

,使用戶可以通過旋轉手機倒掛「鎖定」的方向爲橫向。

相關問題