2010-05-25 72 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); 
} 
相关问题