Xcode 6& Swift:iOS 7 iPhone 5设备上的视图控制器上方和下方出现黑条 [英] Xcode 6 & Swift: Black bars appear above and below the viewcontroller on iOS 7 iPhone 5 device

查看:175
本文介绍了Xcode 6& Swift:iOS 7 iPhone 5设备上的视图控制器上方和下方出现黑条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个单一的视图测试应用,并尝试在安装了iOS 7的iPhone 5上运行它。看起来屏幕设置为iPhone 4大小,黑色条显示在视图控制器的上方和下方。我刚刚使用Xcode 6创建了该项目,并试图在不触及任何其他设置的情况下运行它。还有其他人看过这个吗?

I created a single view test app and tried running it on my iPhone 5 with iOS 7 installed. It looks like the screen is set to the iPhone 4 size and black bars appear above and below the view controller. I just created the project with Xcode 6 and tried running it without touching any other settings. Has anybody else seen this?

推荐答案

为了解决这个问题,你必须为app你的设备创建启动画面图像支持。

In order to solve this problem you have to create launch-screen images for the devices your app supports.

启动新应用时:

例如,让我们说你的应用程序支持iPhone> 4s,因此iPhone:4s,5,5s,6和6plus。

For instance let's say your app supports iPhones > 4s, so iPhone: 4s, 5, 5s, 6 and 6plus.

确保制作具有以下尺寸的启动图像:

Make sure to make launch-images which have the following dimensions:


  • iPhone4s = 640×960

  • iPhone5,5s = 640×1136

  • iPhone6 = 750 X 1134

  • iPhone6plus = 1242×2208个

  • iPhone4s = 640 × 960
  • iPhone5, 5s = 640 × 1136
  • iPhone6 = 750 x 1134
  • iPhone6plus = 1242 x 2208

有关iOS屏幕尺寸的更多信息,请参阅此有用的图表

选择您的项目,然后选择常规设置:

选择或制作启动屏幕单击项目时的常规部分。

Select or make launch screens in the general section when clicked on your project.

然后确保添加或选择启动图像资产:

转到images.xcassets并选择左侧的LaunchImage,然后选择设备您的应用支持(在右侧)

确保将图像放在正确的位置,您可以选择虚线方块并在属性检查器中查看(右侧)屏幕上的部分)您的图片需要满足哪些尺寸。

现在,在模拟您的应用时,所有黑条都消失了。

Now when simulating your app all black bars have disappeared.

这篇关于Xcode 6& Swift:iOS 7 iPhone 5设备上的视图控制器上方和下方出现黑条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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