本文介绍了UIImage imageWithXAssets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的项目中有两个资产,或者我的项目中可能有更多资产.

Assume I have two assets in my project or I may have even more assets under my project.







  • 问题1:我可以在一个项目中拥有多个资产,是正确的吗?
  • 问题2:如果在不同的xcode资产中为同一图像集设置相同的名称怎么办?例子. AppImages.xcassets01 ConsumerSelectionVCtr.xcassets中存在"AppIcon".为什么编译器没有向我显示多个xcassets中相同图像集的错误.
  • 问题3 :如何从xcassets加载图像?
  • 问题4:是否最好在项目中的所有图像上使用xcassets?
  • Question 1: I can have multiple assets in one project & that is valid, correct?
  • Question 2: What if I set same name to an image-set in different xcode-assets? Example. "AppIcon" exists in AppImages.xcassets and 01 ConsumerSelectionVCtr.xcassets. Why compiler is not showing me errors for same image-set in multiple xcassets.
  • Question 3: How to load an image from xcassets?
  • Question 4: Is it preferable to use xcassets for all images in project?

推荐答案

请参见 Apple的资产目录文档

  1. 是的,这可能有助于您整理图像
  2. 我认为一个人会覆盖另一个人.不要给两个图像"同名
  3. 像以前一样,以[UIImage imageNamed:@"LaunchImage"]为例
  4. 是的,部署到iOS 7的应用程序可以利用Xcode功能来减少应用程序的下载时间(Xcode会自动执行此操作)
  1. Yes, and this may help you to organise images
  2. I think one will overwrite the other. Don't give two 'images' the same name
  3. As before, use [UIImage imageNamed:@"LaunchImage"] for example
  4. Yes, apps deployed to iOS 7 can take advantage of an Xcode feature which reduces your app's download time (Xcode does this automatically)

这篇关于UIImage imageWithXAssets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-07 01:25