Automatic resizing for 'non-retina' image versions

前端 未结 9 1621
生来不讨喜
生来不讨喜 2021-01-30 15:03

I\'m looking for a solution that can save me from maintaining two versions of the same image, one for Retina displays (aka @2x), one another for non-Retina displays. My goal is

9条回答
  •  执念已碎
    2021-01-30 15:27

    It's trivial:

    1. Only include @2x images in your project.
    2. Make sure those images have the @2x suffix.

    The system will automatically downscale for non-retina devices.

    The only exception is if you are doing manual, low level Core Graphics drawing. You need to adjust the scale if so. 99.9% though, you don't have to worry about this.

提交回复
热议问题