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

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

问题描述

我一直在 Info.plist 中为我的应用程序的启动图像设置自己的名称

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

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

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 7,如果是这样,我应该为相应的启动图像命名(现在有iOS6.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"的文件.去那里,找到与特定目标相对应的应用程序图标和启动图像目录.您可以将图像文件从查找器拖放到目录中的插槽中,并从左侧的列表中重命名图标/默认组.

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天全站免登陆