开发者

2 Targets 1 Icon Name

My program has two targets and I want to correctly configure this screen:

2 Targets 1 Icon Name

I successfully configure the "App Icon" and "Launch Images" in .plist file, setting the key CFBundleIconFile and CFBundleIconFiles (for icon) and UILaunchImageFile (for launch Image) in the .plist file.

To see this error 开发者_运维知识库yourself, try the following:

  1. Create a new project
  2. Create two or more targets for this project
  3. Go to the screen above (select the project icon in XCode, in targets select the "summary" tab)
  4. Select an image to be the icon of this target
  5. The icon will be added to the project and automatically saved in the root project directory in the file system with the name "Icon.png"
  6. Go to another target and select another image to be the icon of this target
  7. Here is the problem. The system will say: "Want to replace this file?" If I say yes, it overwrites and the first target icon is replaced!!! If say no, nothing is done.

Is there a way to configure two different icons and two launch images to appear in this screen for each target? I can correctly configure it in the .plist file, but in this screen it looks like I have no image!


You need store icons in different folders.

  1. Create 2 subfolders in "images" (in file system, not in Xcode)

2 Targets 1 Icon Name

 2. Create corresponding "group" (yellow folder) in Xcode and set right path for them (optional)

 3. Add all icons to project (in corresponding groups)

2 Targets 1 Icon Name

 4. Set "Target membership" (in the right panel in Xcode) to right target for each icon.

2 Targets 1 Icon Name

 5. The info.plist file(s) should reference to right icon name.

2 Targets 1 Icon Name

Also be aware of:

  • All files from subfolders of "images" will be placed in one root folder in device's file system, so it is never mind, that images located in different folders in developer's machine. If you have files with some name in different folders, only one may be placed in final bundle. It is why you need specify "Target membership".

  • Do not set arbitrary names for lancher icons. Some devices may no recognize icon, if it named arbitrary, ever if it is mentioned in info.plist file (see here).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜