2013-02-08 48 views
0

我有一個UITabBarController,並且每個選項卡處理不同的UIViewController,根據需要將新控制器壓入堆棧。每UIViewController與NIB創建和方法包括:如何使用UITabBarController應用程序進入橫向模式?

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

,但我發現,當我進入與橫向模式的應用程序,它不與縱向模式,爲什麼工作,還是? 和我的ipad應用程序,它可以工作,並且plist已經爲所有設備方向設置了「支持的界面方向(iPad)」和「支持的界面方向(iPhone)」。和xcode的目標啓用「支持的界面方向」按鈕爲灰色,但仍不適用於iPhone,並且iPad會罰款,爲什麼?非常感謝你!!!

回答

2

您正在測試哪個iOS?

- (BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation;

是對iOS5的

如果你是iOS6的確保這些被點擊的應用程序設置。 enter image description here

+0

是的,我測試了所有這些,但沒有工作。並且我知道TabController的所有控制器都將添加委託方法:shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation,但仍然不起作用,爲什麼? – jin

+0

再次。你測試的是哪個iOS版本。 – endy

相關問題