Retina compatibility question: Can I add @2x to my own images for retina compatibility?
-
30-09-2019 - |
문제
If I append the @2x suffix to my own images, will iOS 4 automatically replace my images with the Retina compatible ones, or does that only apply to Apple defined images? (Icons, for example.)
해결책
Yes, of course. If you display a myimage.png
in your app, you may add a retina ready myimage@2x.png
, so it is shown on retina devices.
See this guide for further information.
다른 팁
From the documentation:
The bundle- and image-loading routines automatically look for image files with the @2x string when the underlying device has a high-resolution screen.
So using for example [UIImage imageNamed:@"MyImage.png"]
will automatically look for MyImage@2x.png
when running on a device with retina display.
제휴하지 않습니다 StackOverflow