2010-05-12 122 views
2

我使用帶有4個視圖的UITabBarController。這4個視圖中的第一個應該可以旋轉,其他三個不能。現在問題是,當有一個標籤欄控制器時,你必須將所有使用的視圖設置爲可旋轉的(即在shouldAutorotateToInterfaceOrientation中返回TRUE)。iPhone:防止旋轉視圖

所以,我的問題是現在,即使shouldAutorotateToInterfaceOrientation方法返回TRUE,我可以防止旋轉三個視圖嗎?

回答

1

有點晚,但也許人們可以說這樣的事情在所有shouldAutorotate ...方法解決這個問題:

if (firstTabBarIsShowing) { 
    return YES; //enable rotation if first tab bar is showing its content 
} else { 
    return NO; //if other views are showing, don't rotate anything 
} 

然後確保視圖與第一標籤欄顯示開始。也許這可能會欺騙它。