2011-11-30 61 views
2

我有一個我只想在橫向視圖中看到的iPad遊戲。我選擇從目標的總結橫向視圖,並讓代碼支持的方向不限制實際的方向

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return YES; 
} 

在其中加入navController我的第一個視圖控制器。但是通過改變目標的方向我可以看到的唯一影響不是它如何旋轉,而是它首先加載的方向。有沒有人有任何想法?謝謝!

回答

2

試試這個:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 
+0

它有趣,像我viewcontrollers的90%的工作,但由於某種原因只是其中之一鎖定在橫向模式下,但它不會允許它是否能夠旋轉180°我把它翻過來......想法? –