Get device image scale (e.g. @1x, @2x and @3x)

前端 未结 1 822
甜味超标
甜味超标 2020-12-30 21:12

I have an app that uses a service to get some icons.

With this service I can get any image of any size, so I\'ve planned to get the 3 images (@1x, @2x and @3x) and

相关标签:
1条回答
  • 2020-12-30 22:01

    Use

    [UIScreen mainScreen].scale;
    

    this will give you the exact scale as per device.

    In Swift 3

    UIScreen.main.scale
    

    Cheers.

    0 讨论(0)
提交回复
热议问题