在我的應用程序中,我得到了2 UIViewControllers
,第一個是UINavigationController
中的根控制器,第二個是通過推向UINavigationController's
堆棧調用第一個。UINavigationController中的UIInterfaceOrientation
所以第一個視圖應該只是縱向,第二個視圖應該支持所有的方向。
我在第一這段代碼中寫道:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
return toInterfaceOrientation == UIInterfaceOrientationPortrait;
}
但它仍然旋轉至所有方向。爲什麼?
嘗試使用新的iOS SDK 6.0自轉方法:'shouldAutorotate','supportedInterfaceOrientations','preferredInterfaceOrientationForPresentation' – George 2013-04-23 09:01:01
@George仍然一無所獲(( – 2013-04-23 09:05:59