Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't my Asset Catalog returning R4 images?

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.

Image Set

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

like image 853
Neal Ehardt Avatar asked Sep 20 '13 19:09

Neal Ehardt


2 Answers

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.

like image 168
Coolsinus Avatar answered Oct 28 '22 15:10

Coolsinus


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.

like image 22
Tomasz Bąk Avatar answered Oct 28 '22 14:10

Tomasz Bąk