iPhone - 多个目标是多个发射图像的噩梦 [英] iPhone - multiple targets multiple launch images nightmare

查看:88
本文介绍了iPhone - 多个目标是多个发射图像的噩梦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目包含两个版本的两个应用程序,iPhone和iPad。因此,该项目有4个目标。它显然不是通用的。

I have a project with 2 applications in two flavors each, iPhone and iPad. So, the project has 4 targets. It is obviously not universal.

为了方便起见,我们可以调用每个应用程序AAA和BBB。

To easy things, lets call each application AAA and BBB.

发布图片的名称如下:

适用于iPhone的AAA


  • AAAiPhone.png

  • AAAiPhone@2x.png

适用于iPad的AAA


  • AAAiPad-Portrait @ 2x。 png

  • AAAiPad-Portrait.png

  • AAAiPad-Landscape@2x.png

  • AAAiPad-Landscape。 png

  • AAAiPad-Portrait@2x.png
  • AAAiPad-Portrait.png
  • AAAiPad-Landscape@2x.png
  • AAAiPad-Landscape.png

BBB图像具有相同的名称结构,名称中使用BBB而不是AAA。

The BBB images have the same name structure, with BBB instead of AAA in the name.

我已将此UILaunchImageFile添加到每个plist中,如下所示:

I have added this UILaunchImageFile to each plist, like this:


  • 适用于iPhone的AAA ...启动图像( iPhone)= AAAiPhone.png

  • 适用于iPad的AAA ...启动图像(iPad)= AAAiPad.png

  • 适用于iPhone的BBB ...启动Image(iPhone)= BBBiPhone.png

  • BBB for iPad ...启动图像(iPad)= BBBiPad.png

  • AAA for iPhone ... Launch Image (iPhone) = AAAiPhone.png
  • AAA for iPad ... Launch Image (iPad) = AAAiPad.png
  • BBB for iPhone ... Launch Image (iPhone) = BBBiPhone.png
  • BBB for iPad ... Launch Image (iPad) = BBBiPad.png

当我将图像拖到Xcode上的适当占位符时,它适用于AAA,但是w如果我为BBB这样做,它会覆盖所有AAA图像。它似乎忽略了info.plist信息。

When I drag the images to the proper place holder on Xcode it goes fine for AAA, but when I do that for BBB it overwrites all AAA images. It appears to be ignoring the info.plist information.

任何线索?

谢谢

推荐答案

这是因为图像被重命名为默认。 png(或每个目标的其他名称相同)。

It's because the images are renamed to Default.png (or another name same for each target).

你需要这样做:

添加每个目标的plist中的条目。
iPad:启动图像(iPad)
iPhone启动图像(iPhone)

Add a entry in your plist for each target. iPad: Launch image (iPad) iPhone Launch image (iPhone)

为每个目标使用不同的字符串。
将带有该字符串的图像放入资源文件中(同时确保所需图像仅在所需目标中处于活动状态)。

Use a different string for each target. Place the images with that string to your resource files (also make sure that only the desired images are active in the desired target).

示例


  • 目标1

  • Target 1


  • plist:启动图像(iPad)= AAADefaultiPad

  • 放置文件:AAADefaultiPad@2x.png和AAADefaultiPad.png

目标2


  • plist:启动图像(iPad)= BBBDefaultiPhone

  • 放置文件:AAADefaultiPhone@2x.png和BBBDefaultiPhone.png

编辑1:
放置图像,就像将图像文件放入图形资源一样。不要将它放在TargetSummary下的图像空间中。

Edit 1: Place the images as you would place a image file into your graphic resources. Do not place it in the image space under Target "Summary".

非常适合我。

这篇关于iPhone - 多个目标是多个发射图像的噩梦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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