iPad横向启动图像逆时针旋转90度



我刚刚为我编写的应用程序添加了一个启动映像。根据几个来源,该图像应该是1024 x 748(状态栏减去20像素)。

所以我创建了这样一个图像,命名为Default Landscape~ipad.png,并在-Info.plist中设置这些值:

<key>LSRequiresIPhoneOS</key>
<true/>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationLandscapeRight</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UILaunchImageFile~ipad</key>
<string>Default-Landscape~ipad.png</string>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
<key>UILaunchImageFile</key>
<string>Default-Landscape~ipad.png</string>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

我知道,里面有UILaunchImageFile和UILaunchImageFile~ipad,我也试过了,里面只有一个。

我观察到的是,发布图像是显示的,但它逆时针旋转了90度,缩放到覆盖整个屏幕(这会产生一些不可见的部分),然后进行裁剪。

无论我尝试了什么,我都无法使发射图像在横向方向上正确显示。

我写的那个应用程序只是iPad,不是通用的应用程序,它适用于运行iOS 5.1的iPad 1。我使用Xcode 4.3.1。

我需要做些什么才能在横向方向正确显示发射图像?

编辑:在MainWindow.xib中,主窗口是纵向的,我认为这可能会影响问题。我已经将主窗口设置为纵向模式,因为在横向模式中添加和删除子视图是个问题。我在StackOverflow上也得到了这个提示。因此,真正的问题可能是:我如何创建一个在横向模式下工作的iPad应用程序,并在其中向主窗口添加/删除子视图?

谢谢你的提示,托尔斯滕。

如果您想使用UILaunchImageFile键为图像命名,则名称将是图像名称的基础(第一部分)。您的是:默认Landscape~ipad.png,这意味着实际名称应该是:默认横向~ipad.png LandscapeLeft.png…用于左侧横向。您可以使用默认的命名约定:

Default-Landscape.png
Default-Portrait.png
Default-LandscapeLeft.png
Default-LandscapeRight.png
Default-PortraitUpsideDown.png

并且不要使用UILaunchImageFile密钥,或者如果您想使用它,请将其命名为:IpadLaunchImage,键下UILaunchImageFile~ipad然后:

<key>UILaunchImageFile~ipad</key>
<string>IpadLaunchImage</string>
IpadLaunchImage-Landscape.png
IpadLaunchImage-Portrait.png
IpadLaunchImage-LandscapeLeft.png
IpadLaunchImage-LandscapeRight.png
IpadLaunchImage-PortraitUpsideDown.png

然后以相同的方式为iPhone创建另一个密钥,但使用UILaunchImageFile~iPhone密钥和不同的名称,例如:IphoneLaunchImage。

同样直接来自苹果文档:

无论系统显示哪个启动图像,您的应用程序最初总是以纵向启动,然后旋转根据需要调整到正确的方位。

链接如下:http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html

两件事:

  1. 你不必为顶部栏删除20个像素,iOS会为你做到这一点
  2. 在预览中打开启动图像,使用cmd-r旋转90˚并保存。再次尝试通过Xcode启动

最新更新