What's wrong with my asset catalog containing launch images?
Asked Answered
J

2

3

I'm not using storyboards here, for reasons that would be a distraction to get into. I'm instead trying to add four launch images to an asset catalog:

enter image description here

My app doesn't support iPads or 3.5-inch iPhones, so these should be sufficient. Is that fine or do I need landscape as well?

Here are the properties of each of the images:

enter image description here

enter image description here

enter image description here

enter image description here

Here's the same information in textual form:

      filename: LaunchImage.launchimage
      children:                     
                filename: 5.5.png
                idiom: iphone
                subtype: 736h
                scale: 3x
                orientation: portrait
                extent: full-screen
                minimum-system-version: 8.0
                image: 
                       height: 2208
                       width: 1242

                filename: 4.7.png
                idiom: iphone
                subtype: 667h
                scale: 2x
                orientation: portrait
                extent: full-screen
                minimum-system-version: 8.0
                image: 
                       height: 1334
                       width: 750

                filename: 3.5-inch, 2x-1.png
                idiom: iphone
                scale: 2x
                orientation: portrait
                extent: full-screen
                minimum-system-version: 7.0
                image: 
                       height: 960
                       width: 640

                filename: 4.png
                idiom: iphone
                subtype: retina4
                scale: 2x
                orientation: portrait
                extent: full-screen
                minimum-system-version: 7.0
                image: 
                       height: 1136
                       width: 640

Here's how my app is configured:

enter image description here

When I run the app on the iPhone 7 Plus, I see the 4.7-inch launch image. Why is this happening, and how do I fix it?

I tried using plain PNG files without putting them in an asset catalog, but that doesn't work, either, as discussed in this separate question.


Note that unlike other questions asking about this:

  • I'm not using xibs or storyboards, for reasons that would be a distraction to get into here.

  • I'm using PNG files wrapped in an asset catalog, as opposed to plain PNG files in the top-level directory.

  • I support only iOS 10 and above, which means I don't support 3.5-inch phones.

  • I don't support iPads.

  • I'm using Xcode 8.3 and running iOS 10.3 on my phone.

Jezreel answered 2/4, 2017 at 12:11 Comment(9)
Why use launch images instead of a launch screen storyboard?Oratorical
I want portrait-only launch images. Is that possible with a storyboard? The other reason is that my UI is all built programmatically, so it will take a lot of effort to replicate that perfectly it Interface Builder, for no benefit. Easier to take three screenshots, one for each screen size of iPhone that runs iOS 10.Jezreel
You only need a single storyboard with a label, slider, and button. I do all of my apps purely in code but use a launch screen storyboard to make it easy to support all devices and sizes. And your launch screen storyboard or launch images has nothing to do with whether your app is portrait-only or not. That's a separate setting.Oratorical
My app supports all three orientations but I want the launch storyboard to display only in portrait. Is that possible? With launch images it is — just add one for portrait but not for landscape.Jezreel
The launch screen/storyboard should be a simplified version of your main app screen. If that app screen supports landscape then there is no reason to have a portrait-only launch screen/storyboard. Give a try. You can create a quick dummy launch screen and setup your app to use it. See what happens on a real device when you launch. If you don't like it, delete it and change your app back to using the launch images. 5 minutes of work.Oratorical
It's more complex than that. Let's chat: chat.stackoverflow.com/rooms/info/139717/chat-with-rmaddyJezreel
To keep the discussion focused, please answer the question asked — can I have a launch storyboard that shows in portrait orientation only, while the app supports multiple orientations? I can do this with launch images. Can I do it with a launch storyboard?Jezreel
I had a similar problem and solve it with adding a launch image for every resolution. I mean the same image with different sizes. Perhaps it can help youFlyaway
Check this https://mcmap.net/q/111477/-launch-image-not-showing-up-in-ios-application-using-images-xcassetsPongid
F
0

I had an issue very similar to this recently, where my 4.7" iPhones were unable to load the 667h launch image and fell back to the size it could, being the 538h. Since iOS uses the presence of static launch images as one of its determinations for what resolution to display the app at, the app ended up coming out all blown up in resolution.

It doesn't sound like you're hitting that latter consequence, but I can share my fix: re-evaluate the color space you used to export those images and try exporting them again. I wasn't able to pin down the exact reason why the images were an issue for the platform, but re-exporting and cleaning helped. In addition to the color space, did you perhaps use a Save for Web option? I also found that affected things for us.

Faxun answered 11/4, 2017 at 12:18 Comment(1)
I do want the iPhone 7 and 7 Plus to use P3 launch images, ideally. Otherwise colors will appear to shift when the launch image is replaced by the app. I didn't use save for web. My launch images are screenshots from the device, so it's counter-intuitive that iOS isn't able to use launch images taken on iOS, but next time I'll try re-exporting.Jezreel
F
0

Have you tried cleaning the project and the build folder, deleting derived data, removing the app from the device and restarting Xcode?

Might sound like a silly suggestion, but this has fixed so many things for me in the past.

Fenrir answered 11/4, 2017 at 13:8 Comment(1)
I tried all the above but restarting Xcode. I'll try that next time. Thanks for the suggestionJezreel

© 2022 - 2024 — McMap. All rights reserved.