-2

I have a simple out of box app that doesn't use the entire screen when I deploy it on a iphone5s. By default it creates a LaunchScreen.xib. I have not edited this file on purpose.

Black Bars top and bottom

Other answers suggest to add a Default-568h@2x.png launch image, but I am not using a launch image, and I am not sure where to add these. I see a place for this in the Images.xcassets by clicking the + icon and selecting New Launch Image.

Do I need to add a New Launch Image to Images.xcassets? If so what is the point of having a LaunchScreen.xib?

Thanks!

Community
  • 1
  • 1
HPP
  • 1,074
  • 1
  • 13
  • 28
  • 1
    What version of iOS is on the iPhone 5s? – rmaddy Dec 10 '14 at 22:48
  • 3
    Note: The LaunchScreen.xib is only used on devices with iOS 8. If your app support iOS 7 or earlier, you must include all appropriate launch images for those devices. – rmaddy Dec 10 '14 at 22:50
  • I see, That makes sense. And certainly clarifies the issue for me. I am running iOS 7.1 now. – HPP Dec 11 '14 at 20:20
  • I add the correct size launch images but the same problem persists. In fact there is no launch image when the app starts, just a black screen... but that just might be when deploying the app. Very similar to this question: http://stackoverflow.com/questions/19671868/app-not-using-full-height-of-iphone-5 – HPP Dec 11 '14 at 22:13

2 Answers2

6

To get the app to display full screen:

As suggested here (https://stackoverflow.com/a/15328339/4347877), you must include a Default-568h@2x.png launch image (for iOS 7 or earlier). Or if your deployment target is iOS 8 or higher, you have the option of using LaunchScreen.xib.

Why Use LaunchScreen.xib? For iOS 7 and earlier, app developers had to provide separate launch images for all screen sizes, resolutions and orientations their app supported. For universal apps, up to seven images were required: retina and non-retina versions for 3.5-inch iPhones in portrait and for iPads in portrait and landscape; and another retina image for 4-inch iPhones (the iPhone requires no landscape version because apps are always launched from the portrait-only Home screen).

Creating these images is a nuisance. Xcode 6 comes to the rescue by allowing you to specify a storyboard whose initial view controller will then be used as the app’s launch screen.

If you want to add a launch image instead of using LaunchScreen.xib:

Click on your Images.xcassets folder, right-click in the left pane, and select "New Launch Image." Once you have the correct launch image sizes for all devices you would like to support, drag each image to its respective slot (e.g. "Retina HD 5.5" or "iPhone Portrait 2x"). Before Xcode 6 introduced LaunchScreen.xib I used to create my launch image size here: http://www.appiconsizes.com.

Community
  • 1
  • 1
Keron
  • 167
  • 8
  • 1
    Much of this answer is wrong. An app with no launch images and just the launch screen sib won't work properly when run on a device with iOS 7 or earlier. If the app supports iOS 7 or earlier, in addition to iOS 8, you must supply launch images and optionally supply the launch screen sib. – rmaddy Dec 11 '14 at 03:55
  • Maddy, this answer actually doesn't say anything about the LaunchScreen.xib working for iOS7 and earlier. So I would not go as far as to say it is wrong. It explains LaunchScreen.xib but doesn't explain the problem. Which you comments clarify. – HPP Dec 11 '14 at 20:27
  • Your answer makes it sound like you use either the launch screen xib OR the launch images. But in many cases you use both. – rmaddy Dec 11 '14 at 21:00
  • okay but that doesn't answer my the launch image is not working if it this is what is causing the black bars on the top and bottom of my app. – HPP Dec 11 '14 at 22:09
0

Okay the solution I found came from this question. The answer from James Nick Sears actually fixes my problem. This is after adding the Launch Images. It should be noted that launch images using the images.xcasset is the prefered way to do this pre iOS 8.0 and the only way to make your app compatible with devices running iOS 7 and earlier.

I suggest using TiCons to create the icons, the mapping took me longer then it should have to figure out. In xcode you can see the expected image size for each device by selecting the empty image box and looking in the attribute inspector window on right.

But the real kicker is clicking the 'use asset catalog' button on the "App Icons and Launch Images" of your apps settings under the General tab. Once you click Migrate you can select your LaunchImages from the selection menu that resides where the button used to be, after "Launch Images Source". Without doing this your app won't work correctly on pre iOS 8 devices.

Community
  • 1
  • 1
HPP
  • 1,074
  • 1
  • 13
  • 28
  • Why did it take you any time to figure out the launch images? Xcode shows you exactly what each size should be for the various launch images. No guessing or research required and the images can be named anything you want. Simply drag and drop the properly sized image into the correct spot on the launch image asset. – rmaddy Dec 11 '14 at 22:54
  • I don't know, I am not very familiar with xcode and I had closed the little side bar. But yes I see that now thanks :) Let me edit the answer. – HPP Dec 11 '14 at 22:56