【发布时间】:2010-06-01 05:45:47
【问题描述】:
在 iPad 上以横向启动应用程序时面临一个问题。 我开发了 iPhone 应用程序,后来我移植到了 iPad。
我已经在 info.plist 中设置了方向
[ UISupportedInterfaceOrientations~ipad ] to support all orientation UIInterfaceOrientationPortrait , UIInterfaceOrientationPortraitUpsideDown , UIInterfaceOrientationLandscapeLeft , UIInterfaceOrientationLandscapeRight.
但是当我以横向模式启动 iPad 应用程序时,它总是以纵向模式启动。
沿着这条路
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{ return YES; }
帮帮我,如果我错过了什么..
谢谢,
萨加尔
【问题讨论】:
-
如果您定义了对所有方向的支持,那么您的视图将与您的设备处于相同的模式。即如果您的设备处于纵向模式,那么您的视图将以纵向模式显示。更改设备方向也会更改视图方向。
-
感谢 Jim 的回复。但是当方向处于横向模式时我正在启动应用程序......它仍然以纵向模式启动(即按照主页按钮的方向)。我需要在开始时实现正确的方向,因为需要显示横向屏幕或纵向屏幕。