For an iPhone only, iOS 7+ app, can we include only @3x images?

后端 未结 3 975
不思量自难忘°
不思量自难忘° 2021-02-05 08:29

In an effort to reduce bundle size, is it possible (and a good idea) to only add @3x images?

To clarify, I\'m not referring to the app icon, launch image, etc. But imag

3条回答
  •  鱼传尺愫
    2021-02-05 09:05

    In my testing, I've found @3x isn't recognized on iOS 7 and below. So if you plan to support iOS 7 & 8, you'll definitely want to include @2x images.

    As for the resolution of said images, I haven't found a satisfactory answer yet. For the app I'm working on, taking the example of a fullscreen jpg (likely a photo), I would save at 1242x2208 for @3x and 750x1334 for @2x to match the highest resolution those images will be displayed at on an iPhone. It's not a pixel perfect solution since the images will need to be scaled down on non-iPhone 6(+)'s but I think it's a good middle ground that doesn't involve too much extra work with if statements dictating which image based on the screen size (ugh) and 5 different images.

    One thing to note about performance concerns dfmuir brings up is that these images are going to end up being scaled down in a lot of cases, 4/4S, 5/5S, 6/6+ in display zoom mode, even if you go with apple's preferred method of including 3 images at @1x, @2x, and @3x, since we now have 5 (or 6 including 3gs) different resolutions (See the rendered pixels row in this chart for more info: http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions)

    The only way you don't get these issues with photo-like images (so not considering UI elements), is if you design it such that your images are in relation to points (so staying the same size relative to say your thumb instead of relative to the phone's screen size), but that doesn't always make sense for the app's design. An example would be cropping on the lower resolution phones instead of being scaled down.

提交回复
热议问题