我已经添加了两个图像。Default-Portrait.png 和 Default-Landscape.png。但是每当我启动我的应用程序时,无论方向如何,都只会显示纵向默认图像。
为什么会这样?
我已经添加了两个图像。Default-Portrait.png 和 Default-Landscape.png。但是每当我启动我的应用程序时,无论方向如何,都只会显示纵向默认图像。
为什么会这样?
我遇到了同样的问题,并通过将以下内容添加到 Info.plist 文件(来自 Xcode)中来解决它:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
您是否添加了代码以根据方向交换图像?我猜这个应用程序不会知道你想要什么图片,除非你告诉它。
UIInterfaceOrientation 参数