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

后端 未结 3 972
不思量自难忘°
不思量自难忘° 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:07

    Yes you can, but you shouldn't.

    If you only add @3x images it will both reduce your bundle size and be compatible with all screen densities.

    Update: As of iOS 9, Apple has introduced App Thinning which means that including more image sizes will no longer increase your bundle size. The App Store automatically generates a thin binary for each specific device and only includes the appropriate @3x or @2x image sizes.

    I do not recommend only @3x if you need to support older devices. Embedding only @3x images will cause your images to be scaled down each time the app is run. This approach has the following downsides:

    • You have no control over the image scaling mode that iOS uses. Certain images may see significant pixelation and/or artifacts after being scaled automatically.
    • Scaling images can potentially slow app performance. This is especially true on older devices, which will be doing lots of scaling. Using only @3x images will increase the processing time of these scaling operations even more than scaling down from @2x.
    • You will have no opportunity for pixel perfect exporting of assets. Many designers take the time to manually scale their image assets to ensure that fine strokes and textures are not disrupted. This results in the best experience across all device types.

    If you care about your apps looking clear and crisp on most devices, I would highly recommend that you at least export your images @2x and @3x screen densities. Depending on the compatibility needs of the project, I sometimes choose not to export @1x.

    If you are only aiming for iPhones running iOS 7+, then you definitely do not need to export @1x. All @1x iPhone devices do not support iOS 7+. The only @1x devices that you will need to worry about are the iPad 2 and iPad mini (non-retina).

    Another note: in researching your question I heard rumors that Apple may reject your apps for not having images at every density. I have never experienced this. The only thing that I could find in the developer guidelines was this rule.

    2.10 iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution

    To me this seems to imply that as long as it works, you are good. But c'mon man, make it beautiful!

提交回复
热议问题