简体   繁体   English

ios - 将图像添加到捆绑包中的正确方法是什么?

[英]ios - what is the correct way to add images to the bundle?

I am trying to add these images: 我想添加这些图片:

1) Images for the UITabBar
2) The application icon
3) The launch icon

and I just want to make sure I get it right. 而我只是想确保我做对了。 I googled for "adding images to ios bundle" but I seem to be getting some outdated results. 我用Google搜索“将图像添加到ios包”但我似乎得到了一些过时的结果。 I am on xCode 4.3.3 and I am just wondering what are the right steps to add the images to the bundle. 我在xCode 4.3.3上,我只是想知道将图像添加到捆绑包的正确步骤是什么。 Is there a way to organize them on the file system, or its kind of a flat structure where I just add them? 有没有办法在文件系统上组织它们,或者我只是添加它们的平面结构?

Thanks! 谢谢!

You add the image to the project. 您将图像添加到项目中。 Then you choose the right hand Xcode pane, and click top left to get the file view, with the new image selected in the left pane. 然后选择右侧的Xcode窗格,并单击左上角以获取文件视图,并在左窗格中选择新图像。 Scroll down, you see something like "Target Membership". 向下滚动,您会看到类似“目标会员”的内容。 Make sure the checkbox is selected for the image. 确保为图像选中了复选框。 Now it will be included in your bundle. 现在它将包含在您的捆绑包中。 you can get at it now with "[UIImage imageNamed:@"Foo.png"]" etc. 你可以通过“[UIImage imageNamed:@”Foo.png“]”等来获得它。

EDIT: 编辑: 在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM