Why isn't my Asset Catalog returning R4 images?
Solution 1
For the R4 image to be automatically selected by Xcode you have to change the iOS Target to iOS 7. So even if you use the iOS7 SDK, your project target must be iOS 7.
Solution 2
I have found answer thanks to this. Subtype R4 in Asset Catalog works only with iOS 7 and higher. In other case it will use @2x image.
Solution 3
I have same issue and scratched hours. I use localized launch images which make it more complicate. After all, I just change back and not use asset catalog. Name the launch images as Default.png , [email protected] and [email protected]. Localized and Put them in the bundle and make ios recognize automatically. Everything works fine.
Solution 4
The solution that we have used is to update the asset catalog and target only iOS 6 and Prior.
How to do it. Go to the asset catalog. And on the top right corner click on the 'Attribute Inspector' icon. Here you can set the Target OS for the Launch Images. Uncheck the iOS 7 check boxes for iPhone. Now you should be able to see the launch images for these devices. Doing this you will use the 2x Image for R4 as well.
Solution 5
The R4 image worked for me only with this process:
- Delete the problem Image View from the storyboard
- Add a brand new Image View to replace it with the expected asset name, e.g. "Derp"
Related videos on Youtube
Comments
-
Neal Ehardt about 2 years
I'm in the process of migrating my images to an Asset Catalog. My app needs to access the Launch Image after launch and display it on the screen.
Easy enough, but I have different images for short and tall iPhones, and my iPhone 5 is loading the short launch image when I call
[UIImage imageNamed:@"LaunchImage"]
.Okay so maybe I can't do this with a Launch Image. I'll try putting some images in a normal Image Set instead.
No dice. Using an iPhone 5, when I call
[UIImage imageNamed:@"Derp"]
OR when I set an image in Interface Builder, I get the 2x (retina) image instead of the R4 (retina 4-inch) image.Is this feature broken? How to I get the R4 image on my iPhone 5 (iOS 7)?
-
Neal Ehardt almost 11 yearsUnrelated to my immediate problem, but it is a showstopper. Why, Apple? ಠ_ಠ
-
toblerpwn over 10 yearsI have found this untrue in my testing; specifically, R4 is only used when the Deployment Target is iOS 7.0. The device's version does not seem to matter. @Coolsinus has correctly stated this below.
-
Thangavel over 10 yearsI changed iOS target to iOS7. But app not work in iOS6. how to fix this issue in iOS6. I want my R4 image work in both 4inch screen(iOS6 and iOS7)
-
João Nunes over 10 yearsI changed to ios 7 only and it works. Then i changed my project again to ios 6 and r4 still works.. maybe after cleaning will stop working.
-
Alejandro Benito-Santos over 10 years@JoãoNunes FWIW it keeps working until you remove the app from the device. I tried cleaning and clearing derived data and still worked... #AppleWTF
-
João Nunes over 10 yearsfor me the clean project stoped to work. This is an obscure feature :P
-
cynistersix about 10 yearsThis is correct use a UIImage category to get a naming scheme and add another image asset to the xcasset to fetch
-
xarly about 10 yearsI made this, changing the options of 'Attribute Inspector' for the Icons of the app. But, unfortunately is not working properly for iPhones 4 inches with iOS 6.