且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

对于UI图像针对不同屏幕尺寸的大小?

更新时间:2023-01-03 22:45:53

您可以提供适当的命名约定正常,@ 2倍,3倍@,〜iPad的等。

You can add multiple images with providing proper naming conventions normal, @2x, @3x, ~iPad etc.

对于通过苹果单证。
例如,你的形象的名字叫 myBackground.png 然后

For that go through Apple documentations. For example, your image name is myBackground.png then

[UIImage imageForDeviceWithName:@"myBackground"];

然后这里是文件和决议的名单 myBackground

myBackground@2x.png == 960×640

myBackground@2x.png == 960 × 640

myBackground-568h@2x.png == 1136×640

myBackground-568h@2x.png == 1136 × 640

myBackground-667h@2x.png == 1334×750

myBackground-667h@2x.png == 1334 × 750

myBackground@3x.png == 2208×1242

myBackground@3x.png == 2208 × 1242

myBackground〜ipad.png == 1024×768

myBackground~ipad.png == 1024 × 768

myBackground@2x~ipad.png == 2048×1536

myBackground@2x~ipad.png == 2048 × 1536

您需要添加图像,景观带后缀添加像一样:〜景观

Same way you require to add images for landscape with suffix added like: ~Landscape