应用程序在模拟器中全屏启动,但不在设备上启动 [英] App launches in full screen in simulator, but not on device

查看:113
本文介绍了应用程序在模拟器中全屏启动,但不在设备上启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个Xcode 6 Swift项目。在模拟器中选择iPhone 5或5s时,应用程序将以全屏高度启动。但是,在实际设备(iPhone 5s)上运行应用程序时,屏幕只有iPhone 4的高度(即屏幕顶部和底部出现黑条)。

This is an Xcode 6 Swift project. When choosing iPhone 5 or 5s in the simulator, the app launches at full screen height. However, when running the app on an actual device (an iPhone 5s), the screen is only iPhone 4 in height (i.e. black bars appear at the top and bottom of the screen).

奇怪的是我从另一个测试项目重新创建了这个项目 - 在原始项目中我没有遇到这个问题。

The strange thing is that I've re-created this project from another test project - and in the original project I didn't have this problem.

我已经对每个故事板xml文件进行了文本比较,两者大部分都是相同的。我还看了每个的Build Settings,看不出任何明显的差异。最后,每个Images.xcassets目录中指定的json文件都是相同的。

I've performed a text-compare on the storyboard xml files for each, and both are mostly identical. I've also looked at the Build Settings for each, and can't see any obvious differences. Finally, the json files specified in the "Images.xcassets" directory for each are the same.

推荐答案

管理以解决问题。在目标的常规设置中,在应用程序图标和启动图像下,单击使用资产目录按钮并按照选项进行操作。

Managed to fix the problem. In the General settings for the target, under "App Icons and Launch Images" I clicked the "Use Asset Catalog" button and followed the options.

这篇关于应用程序在模拟器中全屏启动,但不在设备上启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆