我的包含启动映像的资产目录有什么问题? [英] What's wrong with my asset catalog containing launch images?

查看:116
本文介绍了我的包含启动映像的资产目录有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里不使用情节提要,这可能会分散注意力.相反,我尝试将四个启动图像添加到资产目录:

我的应用程序不支持iPad或3.5英寸iPhone,因此这些就足够了.可以吗?还是我也需要风景?

以下是每个图像的属性:

以下是文本形式的相同信息:

      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

这是我的应用程序的配置方式:

当我在iPhone 7 Plus上运行该应用程序时,我看到了4.7英寸的启动图像.为什么会发生这种情况,我该如何解决?

我尝试使用普通的PNG文件而不将其放置在资产目录中,但这也不起作用,如解决方案

您是否尝试过清理项目和build文件夹,删除派生数据,从设备中删除应用程序并重新启动Xcode?

听起来像是一个愚蠢的建议,但这在过去已经为我解决了很多事情.

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:

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:

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:

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.

解决方案

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.

这篇关于我的包含启动映像的资产目录有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆