Asset catalog images of type Retina 4 2x not presented on iPhone 6
Asked Answered
F

3

6

I am using Asset Catalog that includes images of both: 2x, Retina 4 2x and 3x. All of those files are used in the correct devices iPhone 4, 4s => 2x, iPhone 5, 5s => Retina 4 2x, iPhone 6+ => 3x , but iPhone 6 which uses the 2x instead of the Retina 4 2x. Has anyone encountered that issue?

Thanks

[Edited text] The image set is a general image and not a launch screen. No matter whether I use universal or device settings, and no matter if I choose that the 2x Retina 4 is 1334 or 1136, the image presented on iPhone 6 is the one of the regular 2x.

I am adding screen shots of the three different settings I chose and for all three the result was the screen shot of the attached simulator

---------------Screen Shot of Simulator (iPhone 6):---------------

Simulator

---------------Screen shot of settings with Device including 568:---------------

Device with 568

---------------Screen shot of settings with Device including 667---------------

Device with 667

---------------Screen shot of settings with Universal--------------- Universal

---------------Screen shot of settings of the image set (device settings & 667 height image)--------------- enter image description here

---------------Screen shot of the launch pad---------------- enter image description here

Fiertz answered 2/11, 2014 at 18:57 Comment(5)
Can you show a screenshot of your asset catalog, your question isn't very clear and it might help.Callaghan
Are you talking about launch images, app icons, or a general image?Schematic
I answered your questions by editing the original questionFiertz
I have the same issue. Did you manage to resolve it and load the correct image (the Retina 4 one) for iPhone 6?Teetotalism
Not yet, I invested many hours on this, seems like a tough one. I would be happy to learn if you find a solution by any chance.Fiertz
G
3

From what I can tell, it seems you want to display a full screen image in native resolution.

Yeah I think this might be a known issue. I don't think you can do it with an asset catalog. I ended up doing it like this guy here: https://mcmap.net/q/326829/-how-to-specify-size-for-iphone-6-7-customised-edge-to-edge-image/342756

My app is landscape, mnd my background image which fills the entire screen in native res I just call like this:

[UIImage imageForDeviceWithName:@"myBackground"];

And here is the list of files and resolutions for "myBackground" (again landscape):

I no longer support 1x. This pretty much covers all iOS 7 and iOS 8 devices. Hope this helps.

Cheers!

Glazed answered 15/12, 2014 at 12:22 Comment(1)
This solution also works well with xcode7 which totally removed retina4 assets (why?? is there another way). It is by default loading @2x images which match iphone4 and 4s rather than images for the taller devices. I am referring to fullscreen images like background (not launch images)Broucek
S
1

This works in Xcode v7.3 and verified in iPhone 4s simulator running iOS v9.3.

To avoid scaling issues, I did the following:

In my Images.xcassets, I created two Images Sets:
intro_screen
intro_screen_4

In the intro_screen I included the following images
1x 320x480
2x 750x1334
3x 1242x2208

In the intro_screen_4 I included only the image for iPhone 4
2x 640x960

In my code, I did the following:

int screenHeight = [ [ UIScreen mainScreen ] bounds ].size.height;

if(screenHeight == 480)
{
    image = [UIImage imageNamed:@"intro_screen_4" ];
}
else {
    image = [UIImage imageNamed:@"intro_screen" ];
}
Samarskite answered 9/9, 2016 at 23:35 Comment(0)
S
0

I believe this is a known issue with device-specific settings in the asset catalog. Use the Universal settings instead (1x, 2x, and 3x). The iPhone 5, 5s, and 6 will then all use the 2x and all will be well.

Servility answered 2/11, 2014 at 19:4 Comment(4)
Thanks, but I also tried that, but the result is the sameFiertz
Let me ask you this: did you remember to create a dedicated iPhone 6 launch image (or use a launch image xib/storyboard)? Because if you didn't, your app is being scaled up on the iPhone 6 and is being treated as if this were a different device.Servility
Yes, I've just added a screen shot of that in the original messageFiertz
But what I'm thinking is, maybe you have to use a launch file (xib) too. Apple says: "You use a launch XIB or storyboard file to indicate that your app runs on iPhone 6 Plus or iPhone 6." So maybe it isn't running natively on the iPhone 6 until you do that.Servility

© 2022 - 2024 — McMap. All rights reserved.