0
這是我的看法層次:如何設置DetailViewController以支持所有方向?
TabBarController => NavigationController => FistTableViewController => SecondTableViewController => DetailViewController
我已經把我的TabBarController只支持肖像模式而這也適用於所有其他的ViewController其下方。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return (interfaceOrientation == UIInterfaceOrientationPortrait);}
但事實是,我希望我的DetailViewController這是最後的ViewController支持所有定向代碼:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);}
但它不工作!它仍然保持縱向模式。 任何其他解決方案?
只是'返回YES;'在'shouldAutorotateToInterfaceOrientation' – 2012-02-11 14:26:44
哪個控制器應該設置它? – 2012-02-11 14:33:44
你想要旋轉的視圖控制器。如果你想旋轉一個標籤欄應用程序,你需要在它的所有子視圖控制器中啓用旋轉。 – 2012-02-11 14:40:50