Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

xcode - What's wrong with my asset catalog containing launch images?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...