问题
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
and01 ConsumerSelectionVCtr.xcassets
. Why compiler is not showing me errors for same image-set in multiplexcassets
. - 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
- Yes, and this may help you to organise images
- I think one will overwrite the other. Don't give two 'images' the same name
- As before, use
[UIImage imageNamed:@"LaunchImage"]
for example - 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