2010-05-25 73 views
0

我正在嘗試製作只能在橫向中查看的應用程序。我查了一些教程(雖然比較老),並做了以下工作:
-set up info.plist包含一個用於uiinterfaceorientation的密鑰
- 在主視圖控制器中,我已將幀設置爲480 x 320iPhone - 僅限橫向應用程序

現在,第一個屏幕加載好了。一切都應該在哪裏,什麼都不是。但是,如果我點擊一個設置爲呈現模式視圖控制器的按鈕,則不會發生任何事情。一切都正確鏈接和編碼,但按下按鈕時沒有任何反應。我試圖強迫景觀做錯了嗎?

這是基本的,這個問題是如何有效地使一個應用程序,只會在橫向模式?謝謝你的幫助。

+0

重複..希望這會有所幫助:http://stackoverflow.com/questions/402/iphone-app-in-landscape-mode – iwasrobbed 2010-05-26 03:42:16

回答

0

您應該只去掉這一方法我告訴你如下:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 
相關問題