Reputation: 2304
I'm testing my app on a physical device (using a provisioning profile). The device is an iPad Air 2 with iOS version 8.1.
My App wasn't appearing full screen, so I managed to get it full screen following the advice to add [email protected]
to the project, as per this thread:
Why [UIScreen mainScreen].bounds] is not returning full screen size?
However, upon adding it to images.xcassets
, I see this:
Question 1) Why is Xcode complaining about a Missing [email protected]
launch image when it's clearly there?
So anyway, this made my app start full screen but the launch image was not appearing. Instead, just a plain black screen was showing up during app load.
Question 2) Why wasn't the launch image showing up?
I deleted all the launch images that were eventually added in an attempt to get something working (because this is iOS and trial and error seems to work way more than a logical process). So at the moment, no launch images exist in images.xcassets
. However, my app still runs full screen. I removed the already installed app from the device (by making the icon wiggle and tapping the 'X'), selecting Product>Clean
from Xcode and building again. No luck. App still appears full screen on future runs. I then attempted to follow the answer by EliSKoren on this thread:
However, the only reference I could find to launch images were for simulators, not physical devices.
Question 3) Trying really hard not to loose it ... What's happening!? Why is my app still appearing full screen even though I've removed launch images?
Upvotes: 0
Views: 2710
Reputation: 5967
This is because Xcode provides placeholders for different devices and respective to them being retina or non retina and device sizes. As you can see your image is on a placeholder as "unassigned", So xcode cant figure it out which device it is for, hence the image is not showing. To correct this here is a screenshot --
Please migrate to get the launch image assigned to the assets from here
Click on Launch Image Sources -- Use assets catalogue and the pop up will show and then click on migrate.
As you can see in the attribute inspector, you can choose which device launch image you want and it will give you that. Check by clicking the place holder what image size or resolution it requires and then you just drag and drop those images from finder. Hope this helps
As it turned out OP was using cMake for the xcode project and by default xcode had already a launch image asset JSON installed which had a wrong configuration, Thus creating another Launch Image wasnt overriding the existing JSON as for cmake the earlier config was being loaded. And by default Universal devices was selected but the Device orientation was totally unchecked. Checking device orientation after getting a clean version of the project and letting Xcode decide its default Launch Image assets and filling up images in that JSON fixed the issue with OP. Further discussions are mentioned in the link in the comments.
Upvotes: 2