iOS 9 Xcode 7 - Application appears with black bar

2018-12-31 14:24发布

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?

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

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

enter image description here

标签: ios ios9 xcode7
11条回答
心情的温度
2楼-- · 2018-12-31 15:04

Go to the asset catalog and create a new iOS launch Image. then in Target>General>App Icons and Launch Images>Launch Image Source you will see automatically the new Launch Image created in the assets catalog.

查看更多
泛滥B
3楼-- · 2018-12-31 15:05

I'm using xcode 7.2 . At first, I created a LaunchScreen.storyboard file, as Potassium Permanganate suggested, and it worked! However, I didn't want a launch screen, so I tried setting Main.storyboard as Launch Screen File and it did the trick!

xcode 7.2

查看更多
只若初见
4楼-- · 2018-12-31 15:13

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.

There are two ways:

a) If you use a launch screen.

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

b) If you don't use a launch screen.

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)

查看更多
时光乱了年华
5楼-- · 2018-12-31 15:13

Don't Do anything that are described in earlier answers...

To show view Controller follow the following single step

Step 1 : Add the splash Screen for iPhone and iPad.

After this this error will not come again.

查看更多
何处买醉
6楼-- · 2018-12-31 15:15

When you migrate your app from earlier version of xCode to xCode 6 or xCode 7, you will face this issue.

For iOS 7 and earlier, developers need to provide separate launch images for all screen sizes, resolutions and orientations their app supported.

In Xcode 6 or later, there is another option. You can specify a storyboard whose initial view controller will then be used as the app’s launch screen. Use below steps:

  • Create a blank storyboard file named LaunchScreen.storyboard.

  • Go to your target settings and, on the "General" tab, select the storyboard as your Launch Screen File in "App Icons and Launch Images" section. Xcode will add a corresponding UILaunchStoryboardName key to your app’s Info.plist. When this key is present, Xcode will prioritize it over any launch images you might have set.

  • Add some subviews to newly created storyboard's view and position them with constraints. When you launch the app on a device, the OS should use the scene as the launch screen.

Delete the older app from simulator and clean the project.

Cheers :-)

查看更多
登录 后发表回答