UIImage imageWithXAssets

送分小仙女□ 提交于 2019-12-23 06:59:27

问题


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




  • 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?

回答1:


See the Asset Catalog documentation from Apple

  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)


来源:https://stackoverflow.com/questions/19294589/uiimage-imagewithxassets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!