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):---------------
---------------Screen shot of settings with Device including 568:---------------
---------------Screen shot of settings with Device including 667---------------
---------------Screen shot of settings with Universal---------------
---------------Screen shot of settings of the image set (device settings & 667 height image)---------------
---------------Screen shot of the launch pad----------------
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://stackoverflow.com/q/25892207/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!
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" ];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With