我想做一個簡單的iPhone遊戲,我需要遊戲在橫向模式。我可以將初始視圖變爲風景,但如果刪除初始視圖並將其替換爲新視圖(從主菜單進入遊戲屏幕),則新視圖現在處於縱向模式。此外,如果我切換回第一個視圖(移除遊戲屏幕,然後創建新的菜單視圖),視圖仍處於縱向模式。我已在Info.plist文件正確設置與景觀權初始化和我有一個設置了下面的代碼GameViewController.m文件:iPhone遊戲風景定位問題
-(BOOL) shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
我看了一下具有建立煩惱的人很多貼子風景取向,但他們似乎總是關於應用程序的初始負載(只顯示一個視圖)。我似乎無法找到任何解決這個問題的方法。有人能幫我嗎?
做你的意見都有shouldAutorotateToInterfaceOrientation:設置爲UIInterfaceOrientationLandscapeRight返回YES? – Tudorizer 2011-04-10 17:40:14