使用Xcode 5在iOS 7中启动图像 [英] Launch Images in iOS 7 with Xcode 5

查看:113
本文介绍了使用Xcode 5在iOS 7中启动图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在Info.plist中的应用程序的启动图像上设置我自己的名字,如

I've been setting my own names on launch images for my apps in the Info.plist like

包含以下图像(正确尺寸,320x480像素default.png和640x960 px for default@2x.png等。)

with the following images in bundle (with correct dimensions, 320x480 px for default.png and 640x960 px for default@2x.png etc.)

启动图像这在iOS 7和Xcode 5之前一直运行良好。现在,当我查看相应目标的常规选项卡时在Xcode 5中,我的启动图像文件与我项目中的其他目标混淆,这让我很担心,即使我在实际运行目标时没有看到错误的启动图像文件。我应该担心吗?选择的图像不在构建目标中,所以我应该没问题,但是有可能获得空白图像吗?

this have been working great prior to iOS 7 and Xcode 5. Now when I look in the General tab for the corresponding target in Xcode 5 my launch image files get mixed up from other targets in my project, which worries me, even though I haven't seen wrong launch image files when actually running the target. Should I be worried? The chosen images isn't in the build target so I should be fine there, but is there a risk of getting a blank image instead?

我的主要问题是,我可以在Info.plist中使用我的默认设置(这有助于自动检测各自的启动图像),如果是这样,我应该将相应的启动图像命名为什么(现在还有iOS 6.1和Prior选项以及不同的尺寸)?这尤其适用于具有新尺寸的iPad Portrait Retina(iOS 7)。 iPad Portrait Non-Retina(iOS 7)上的自动检测是指具有正确尺寸的图像,而不是构建目标中的图像。再次,当运行带有iPad Retina和iOS 7.0的模拟器时,会显示正确的启动图像。

My main question is, can I use my default setup in Info.plist (that help auto detected respective launch images) for iOS 7, and if so, what should I name the corresponding launch images (now that there's the "iOS 6.1 and Prior" options as well with different dimensions)? This especially applies for the iPad Portrait Retina (iOS 7) that has new dimensions. The auto detection on iPad Portrait Non-Retina (iOS 7) refers to an image, not in the build target, that has the right dimensions. Again, when running a simulator with iPad Retina and iOS 7.0 the correct launch image shows.

推荐答案

Anden,我遇到了同样的问题。今天的问题,虽然我已经设置了一半的新目标,就像你设置你的目标一样。

Anden, I ran into the same problem today while adding a new target to the half dozen I already had that were set up in the same way that you set up yours.

我决定使用那个使用资产目录按钮,需要一些工作来设置,但最终大大简化了事情:

I decided to use that "Use Asset Catalog" button, which took some work to set up, but has simplified things greatly in the end:

1-(可选)删除(仅删除参考)图标并从您的项目中启动图像文件。我认为您不再需要文件在项目导航器中。

1- (optional) Delete (remove references only) the icon and launch image files from your project. I don't think you need the files to be in the project navigator anymore.

2-选择主要目标,转到常规和应用程序图标(如上所示)。

2- Choose your primary target, go to "General" and "App Icons" (as you showed above).

3-按使用资产目录按钮,同时选中迁移启动图像。

3- Press the "Use Asset Catalog" button, with the "Migrate Launch Images" checked as well.

4-这会在项目导航器中创建一个名为Images.xcassets的文件。去那里,找到与特定目标相对应的App Icon和Launch Image目录。您可以将图像文件从取景器拖放到目录中的插槽中,并从左侧列表中重命名图标/默认组。

4- This creates a file called "Images.xcassets" in your project navigator. Go there, and find the App Icon and Launch Image catalogs corresponding with the particular target. You can drag and drop image files from the finder into the slots in the catalog, and rename the icon/default groups from the list on the left.

5-一旦你已填满图像插槽,返回每个目标的常规,然后再次按使用资产目录按钮为每个目标。您可以将所有启动图像和图标文件存储在同一个xcassets文件中,而不是为每个文件创建新的xcassets文件。

5- Once you've got the image slots filled up, go back to the "General" for each target, and press the "Use Asset Catalog" button again for each target. Instead of creating a new xcassets file for each, you can store all the launch images and icon files in the same xcassets file.

这篇关于使用Xcode 5在iOS 7中启动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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