xcode 将 JPEG 用于启动图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10590535/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:19:49  来源:igfitidea点击:

Use JPEGs for Launch Images

iosxcode

提问by Dan Rosenstark

This is related to Default-Portrait.png for iPad: any way to make the file size smaller?

这与适用于 iPad 的 Default-Portrait.png相关:有什么方法可以使文件变小?

Is there any way to specify a more efficient file format (like JPEG) for Default-Landscape.png and Default-Portrait.png?

有没有办法为 Default-Landscape.png 和 Default-Portrait.png 指定更有效的文件格式(如 JPEG)?

采纳答案by Fabian

There is no way to use an image other than a png.

没有办法使用 png 以外的图像。

All launch images must be PNG files and must reside in the top level of your app's bundle directory. Section: App Launch (Default) Images

所有启动图像都必须是 PNG 文件,并且必须位于应用程序包目录的顶层。部分:应用启动(默认)图像



Update: JPEG images to work and Apple's documentation no longer specifies that the images must be PNG files.

更新:JPEG 图像可以工作,Apple 的文档不再指定图像​​必须是 PNG 文件。

回答by martinjbaker

Yes it's possible to use jpg files as launch images. Just add "Launch image" key with the base filename (e.g. LaunchImage.jpg") to the Info.plist. Then add files to your project such as

是的,可以使用 jpg 文件作为启动图像。只需将带有基本文件名(例如 LaunchImage.jpg”)的“Launch image”键添加到 Info.plist 中。然后将文件添加到您的项目中,例如

and Xcode will pick them up.

Xcode 会接收它们。

Howeverthrough personal experience I've discovered if you're supporting the larger iPhone 5 screen the App Store expects PNG formatand uses the presence of PNG to determine iPhone 5 support and display of iPhone 5 size thumbnails on the store. Using JPG images will not show the app as iPhone 5 optimized in the app store (even though it will work fine on the device) so it is best to stick with PNG.

但是,根据个人经验,我发现如果您支持更大的 iPhone 5 屏幕,App Store 需要 PNG 格式,并使用 PNG 的存在来确定 iPhone 5 支持和 iPhone 5 大小缩略图在商店中的显示。使用 JPG 图像不会在应用商店中将应用显示为 iPhone 5 优化(即使它可以在设备上正常运行),因此最好坚持使用 PNG。

回答by mxcl

If you use xcassets, then since Xcode 6 you can use JPGs. However Xcode will still not let you drop JPGs into the LaunchImage folder. But you can do it in Finder. Simply drop your PNGs into that folder with Finder and then edit the JSON file changing all .png extensions to .jpg.

如果您使用 xcassets,那么从 Xcode 6 开始您就可以使用 JPG。但是 Xcode 仍然不允许您将 JPG 放入 LaunchImage 文件夹中。但是您可以在 Finder 中进行。只需使用 Finder 将您的 PNG 文件放入该文件夹,然后编辑 JSON 文件,将所有 .png 扩展名更改为 .jpg。

I haven't submitted an app to the store using this yet, but it works in the iPhone simulator at least.

我还没有使用它向商店提交应用程序,但它至少可以在 iPhone 模拟器中运行。

Update: Doesn't work on the device. I'll leave this answer here anyway so people know that this technique was at least tried so the effort won't be repeated.

更新:在设备上不起作用。无论如何,我都会把这个答案留在这里,这样人们就知道至少已经尝试过这种技术,因此不会重复这种努力。