简体   繁体   中英

Xcode launch images and full screen issues

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 Default-568h@2x.png 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 Default-568h@2x.png 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:

Launch image doesn't update

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?

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 --

EDIT

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

Edit Final

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM