Stop using retina-only images

前端 未结 3 1231
野趣味
野趣味 2021-02-14 06:27

What will happen if I do the following:

  • I substitute all non-retina assets with the retina assets
  • I delete all retina assets in my project ( All the
3条回答
  •  一生所求
    2021-02-14 07:14

    In 99% of cases this will work fine. However there are cases where images won't scale correctly (usually depending on the contentMode). I worked with someone who did this exact thing and never noticed a problem, although I think it is terrible practice.

    You will get a lighter binary, but you are asking the older devices (with less memory) to do more work. If you don't want to support these devices then don't, I think this is better than giving users a potentially broken app.

    There are better ways to reduce the size of images in your app, reusing them wherever possible, stretching, tiling etc.

提交回复
热议问题