iOS 9 Xcode 7 - 应用程序在顶部和底部显示黑条 [英] iOS 9 Xcode 7 - Application appears with black bars on top and bottom

查看:160
本文介绍了iOS 9 Xcode 7 - 应用程序在顶部和底部显示黑条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPhone 6 iOS9上安装了应用程序,这就是发生的事情。注意顶部和底部有黑条。它在iOS8上运行得很好。我如何解决这个问题?

Installed the app on iPhone 6 iOS9 and here is what happened. Notice black bars on top and bottom. It works just fine on iOS8. How I can fix it?

我尝试使用Xcode 6.4& 7.相同的结果。

I've tried building with Xcode 6.4 & 7. Same result.

(iPhone 5用于运行这样的iPhone 4应用程序)

(iPhone 5 used to run iPhone 4 apps like this)

推荐答案

您是否从早期版本的Xcode迁移了应用程序?如果是这样,那么Xcode现在假设你的屏幕尺寸,你需要一种在运行时指示实际屏幕尺寸的方法。

Did you migrate your app from an earlier version of Xcode? If so then Xcode is now making an assumption about your screen size and you need a way of indicating the actual screen size at run time.

有两种方法:

a)如果您使用启动屏幕。

您缺少一个LaunchScreen。故事板文件。
创建一个LaunchScreen.storyboard文件并将其添加到您的项目中。

You are missing a LaunchScreen.storyboard file. Create a LaunchScreen.storyboard file and add it to your project.

b)如果您不使用启动屏幕。

转到目标设置并选择常规,然后选择应用程序图标和启动图像。
现在将启动屏幕文件设置为main.storyboard(或适当的其他故事板)

Go to your Target's settings and choose General, then App Icons and Launch Images. Now set "Launch Screen File" to your "main.storyboard" (or another storyboard if appropriate)

这篇关于iOS 9 Xcode 7 - 应用程序在顶部和底部显示黑条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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