Using smaller images for non-retina, retina and HD retina (@ 1x, @ 2x, @ 3x) for universal applications

To support iOS 7 through 8 on universal devices, I have to make 4 copies of the same image of different sizes.

For iPhone image@2x.png (iphone 4s, 5.5s, 6) image@3x.png (iphone 6 +)

For iPad image.png (ipad 2, ipad mini 1) image@2x.png (ipad 3, 4, ipad mini 2, ipad Air)

Images really inflate the size of the application.

Is it possible to simply use 1 image size, the largest of the many and the scale that fits in uiimageview, and use the image to scale the image on smaller screens?

imageView.contentMode = UIViewContentModeScaleAspectFit;

or is it absolutely necessary to have all 4 copies of different sizes?

It works on all devices on the simulator and on the retina of iPad 3, but I have no way of actually testing on other devices, and I'm afraid that images may not be displayed.

Has anyone tried to use 1 large image instead of a set of copies?

+4
source share
1 answer

Yes, you can theoretically use the image with the highest resolution and have UIImageView scale the image down using the mode Aspect Fit.

- , , . , UITableView , , , .

, , ( , ), , .

, , , , imageNamed:.

, , .

, , App Store.

, , - (1x 2x), (2x 3x), . , wifi.

+5

All Articles