您如何更新应用程序图标和启动图像以同时支持 IOS 6 和 7?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18624587/
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-08-31 01:00:01  来源:igfitidea点击:

How do you update the app icons and launch images to support IOS 6 and 7 simultaneously?

iphoneiosxcode5

提问by AndyBean

I have been stymied figuring out how to release an application from Xcode5 that supports IOS7 AND IOS 6+ in the same build, with assets (icons and splash screens) that load correctly for both, AND still render the assets for IOS 6 correctly. The major hangup I had was trying to make IOS 6 still render the icons without shading or highlighting since the "prerendered" optionis no longer even available in Xcode 5's GUI. Any ideas how to get all of the content and the icon to render correctly AND support multiple OS versions?

我一直在努力弄清楚如何从 Xcode5 发布一个应用程序,该应用程序在同一构建中支持 IOS7 和 IOS 6+,资产(图标和启动画面)为两者正确加载,并且仍然正确呈现 IOS 6 的资产。我遇到的主要问题是试图让 IOS 6 仍然在没有阴影或突出显示的情况下渲染图标,因为“预渲染”选项在 Xcode 5 的 GUI 中甚至不再可用。任何想法如何让所有内容和图标正确呈现并支持多个操作系统版本?

Andrew

安德鲁

回答by AndyBean

Apple has clear guidelineson requirements for IOS 7 apps but even then, I ran into errors making a single app support multiple OS versions. After getting it to work, I thought I would point out a few areas that were hangups for me to aid others in the future.

Apple对 IOS 7 应用程序的要求有明确的指导方针,但即便如此,我还是遇到了使单个应用程序支持多个操作系统版本的错误。让它开始工作后,我想我会指出一些对我来说很重要的领域,以在未来帮助他人。

I first updated the whole of my app to support IOS 7 cleanly and then went back and enabled previous versions but that process is not necessary.

我首先更新了整个应用程序以完全支持 IOS 7,然后返回并启用以前的版本,但该过程不是必需的。

Just ensure you first set the correct deploy targetdeployment target

只要确保您首先设置正确的部署目标部署目标

Once you set the deployment target, Xcode5 nicely changes the list of default assets it requires to support the multiple OS versions. Ensure you reupload the correct versions of icons at the required resolutions and required filenames (shown below for IOS6-IOS7 support) Icons, their sizes, and their default filenames in Xcode5 for IOS6 -7 support

设置部署目标后,Xcode5 会很好地更改支持多个操作系统版本所需的默认资产列表。确保您以所需的分辨率和所需的文件名重新上传正确版本的图标(如下所示以支持 IOS6-IOS7) Xcode5 中用于 IOS6 -7 支持的图标、它们的大小和它们的默认文件名

Do the same for the launch images, note that you will have to rename your launch images to new names, Xcode tries doing this for you if you let it. Note the new sizes below, as IOS7 expands the launch image background behind the status bar. Launch images, their names, and sizes required

对启动图像执行相同操作,请注意,您必须将启动图像重命名为新名称,如果您允许,Xcode 会尝试为您执行此操作。请注意下面的新尺寸,因为 IOS7 扩展了状态栏后面的启动图像背景。 启动图像、它们的名称和所需的大小

Finally, manually add the two .plist flags belowand you should be set to have your icons render across IOS versions consistently, with no gloss (explanation follows)

最后,手动添加下面的两个 .plist 标志,您应该设置为让您的图标在 IOS 版本之间呈现一致,没有任何光泽(解释如下)

manually add these entries to your plistIOS7 in its new flatness removes the postprocessing the previous versions did where they added a highlight and gloss effect to icons. That effect is no longer done for IOS 7 apps but if you load an app from Xcode5 on IOS 6, it will reapply the default gloss effect. This is infuriating because there no longer is a "prerendered" GUI flag in Xcode to disable that postprocessing. As mentioned above, you need to add the flag manually to your application's plist. In my case, I had to add the flag in two locationsto force IOS 6 to stop applying the effect. You can access the plist by either opening the file directly or navigating to the settings in your project overview. You may need to uninstall the app from your simulator and then rebuild the app to force simulator to lose its cache of the old icon.

手动将这些条目添加到您的 plistIOS7 在其新的平坦度中删除了以前版本在图标上添加高光和光泽效果的后处理。该效果不再适用于 IOS 7 应用程序,但如果您在 IOS 6 上从 Xcode5 加载应用程序,它将重新应用默认光泽效果。这令人气愤,因为 Xcode 中不再有“预渲染”GUI 标志来禁用该后处理。如上所述,您需要手动将标志添加到应用程序的 plist 中。就我而言,我必须在两个位置添加标志以强制 IOS 6 停止应用效果。您可以通过直接打开文件或导航到项目概述中的设置来访问 plist。您可能需要从模拟器中卸载应用程序,然后重建应用程序以强制模拟器丢失旧图标的缓存。

回答by KodeHyman

If you setup the asset catalogue you can open it select the image and then go to the inspector and tick this box

如果您设置了资产目录,您可以打开它选择图像,然后转到检查器并勾选此框

Screen shot of xcode 5

xcode 5 的屏幕截图

回答by Idan

Just use "asset catalog" (you can select that from general on your target).

只需使用“资产目录”(您可以从目标的常规中选择)。

That would create an images.xcassets on your project there you can easily drag your icon designs for pre iOS 7 and for iOS 7.

这将在您的项目中创建一个 images.xcassets,您可以在那里轻松拖动 iOS 7 之前和 iOS 7 的图标设计。

UPDATE:So after the formal release of iOS 7 I can now write this:

更新:所以在 iOS 7 正式发布后,我现在可以这样写:

On the asset catalog itselfselect the Appiconset that you want to set as pre-rendered then go to Attribute Inspectorand just mark "iOS icon is pre-rendered". you can also set there of course which OS and devices you want to support (it would create all options so you can just drag& drop to set).

在资产目录本身上,选择要设置为预渲染的Appicon集,然后转到Attribute Inspector并标记“iOS icon is pre-rendered”。当然,您也可以在那里设置要支持的操作系统和设备(它会创建所有选项,因此您只需拖放即可设置)。

Important thing to note is that for some reason if you use several targets and several sets inside this catalog you must add the Target Membershipmanually. To do this just mark the "asset catalog" file, go to file inspector and mark all targets where you want to use it. I think Apple should do that automatically when you select the "asset catalog" from the target settings but till then I decided to mention that here (took me an hour to figure this out).

需要注意的重要一点是,出于某种原因,如果您在此目录中使用多个目标和多个集合,则必须手动添加目标成员资格。为此,只需标记“资产目录”文件,转到文件检查器并标记要使用它的所有目标。我认为当您从目标设置中选择“资产目录”时,Apple 应该自动执行此操作,但在那之前我决定在这里提及(我花了一个小时才弄清楚)。

回答by DogCoffee

I went through this recently. Seems by default it only shows the following.

我最近经历了这个。似乎默认情况下它只显示以下内容。

enter image description here

在此处输入图片说明

Easy fix is add a new AppIcon

简单的修复是添加一个新的 AppIcon

enter image description here

在此处输入图片说明

To give you all these options.

为您提供所有这些选择。

enter image description here

在此处输入图片说明

回答by Luis Ferro

My experience with this:

我在这方面的经验:

When creating a new empty app, it will create a "default" app icons / launch images asset catalog that is incomplete as stated by @Smick.

创建新的空应用程序时,它将创建一个“默认”应用程序图标/启动图像资产目录,该目录不完整,如@Smick 所述。

The annoying part of this new "catalog" is that it doesn't show the image sizes.

这个新“目录”令人讨厌的部分是它不显示图像大小。

To work around the issue, select the project on the project navigator, and on the "General" you will notice 2 areas - App Icons and Launch Images. Those will point to an asset catalog. You can change it to "don't use asset catalog." After that, the interface will change to a list of files / dimensions.

要解决此问题,请在项目导航器上选择项目,然后在“常规”中您会注意到 2 个区域 - 应用程序图标和启动图像。这些将指向资产目录。您可以将其更改为“不使用资产目录”。之后,界面将更改为文件/维度列表。

However there are several issues with this interface:

但是这个接口有几个问题:

  1. It should only ask for the retina versions of the images (and compute the normal, or have two links, one for normal and another for retina).
  2. Several images (the launch ones) need to be renamed for them to work (the system does this for you).
  3. Two images are not assignable due to errors (iPad Portrait iOS 7, and iPad Landscape iOS 7, both in normal resolution) - you can specify an image for them, but the image will not stay on and will become de-selected when you insert the next image.
  4. The image dimensions specified are slightly different from the ones stated on the HIG manuals.
  5. I've a strong dislike of the "new" notation of images with points (as they are device dependent and so not exact).
  6. If you don't want to see iOS 6 reapply the "highlight / lighting" on the icons, you need to add a key on the app plist (project manager | project | info. There, you can add a key "Icon already includes gloss effects". You may need to add it also on iOS 5 icons if required.
  1. 它应该只要求图像的视网膜版本(并计算法线,或有两个链接,一个用于正常,另一个用于视网膜)。
  2. 需要重命名多个图像(启动图像)才能使其工作(系统会为您执行此操作)。
  3. 由于错误(iPad 纵向 iOS 7 和 iPad 横向 iOS 7,均为正常分辨率),两个图像无法分配 - 您可以为它们指定一个图像,但该图像不会保持显示状态,并且在您插入时会被取消选择下一张图片。
  4. 指定的图像尺寸与 HIG 手册中所述的尺寸略有不同。
  5. 我非常不喜欢带有点的图像的“新”符号(因为它们依赖于设备,因此不准确)。
  6. 如果你不想看到 iOS 6 重新应用图标上的“高亮/照明”,你需要在应用 plist 上添加一个键(项目经理 | 项目 | 信息。那里,你可以添加一个键“图标已经包含光泽效果”。如果需要,您可能还需要在 iOS 5 图标上添加它。

回答by Mina Fawzy

For Xcode 6

对于 Xcode 6

For LaunchImageyou must make sure you check iOS 6.0 and Prior iPhone (Portrait ) or iPad // depend on your project configuration

对于LaunchImage,您必须确保检查 iOS 6.0 和Prior iPhone (Portrait) 或 iPad // 取决于您的项目配置

Sizes

尺寸

Default.png (320x480) 
[email protected] (640x960) 
[email protected] (640x1136)

enter image description here

在此处输入图片说明

The same to AppIcon

AppIcon相同