Asset catalog for Retina 4 2x images not available on iPhone 6

I use the Asset Catalog, which includes images of both: 2x, Retina 4, 2x and 3x. All these 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 2x instead of Retina 4 2x. Has anyone encountered this issue?

thanks

[Edited text] A set of images is a general image, not a launch screen. Regardless of whether I use the universal or device settings, and whether I choose that the 2x Retina 4 is 1334 or 1136, the image presented on the iPhone 6 is one of the usual 2x.

I am adding screenshots from the three different settings that I selected, and for all three results there was a screenshot of the attached simulator

--------------- Screen shot of the simulator (iPhone 6): ---------------

Simulator

--------------- Screenshot using a device, including 568: ---------------

Device with 568

--------------- Screenshot of a device using it, including 667 ---------------

Device with 667

--------------- Screenshot using Universal --------------- Universal

--------------- Screenshot of image settings (device settings and image height 667) --------- ------ enter image description here

--------------- Screenshot of the launch pad ---------------- enter image description here

+6
source share
3 answers

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

Yes, I think this may be a known issue. I do not think you can do this with an asset catalog. I ended up doing it like this guy: fooobar.com/questions/91792 / ...

My application is a landscape, and my background image, which fills the entire screen in natural resolutions, I simply call like this:

[UIImage imageForDeviceWithName: @ "myBackground"];

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

  • myBackground@2x.png == 960 Γ— 640
  • myBackground-568h@2x.png == 1136 Γ— 640
  • myBackground-667h@2x.png == 1334 Γ— 750
  • myBackground@3x.png == 2208 Γ— 1242
  • myBackground ~ ipad.png == 1024 Γ— 768
  • myBackground@2x ~ ipad.png == 2048 Γ— 1536

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

Hooray!

+3
source

This works in Xcode v7.3 and is tested in the iPhone 4s simulator with iOS v9.3.

To avoid scaling issues, I did the following:

In my Images.xcassets, I created two sets of images:
intro_screen
intro_screen_4

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

In intro_screen_4, I only included an 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" ]; } 
+1
source

I believe this is a known issue with the settings for a specific device in the asset catalog. Instead, use the universal settings (1x, 2x and 3x). IPhone 5, 5s and 6 will use all 2x, and everything will be fine.

0
source

Source: https://habr.com/ru/post/977618/


All Articles