视网膜和非视网膜显示的支持图形 [英] Supporting graphics for both Retina and Non Retina display

查看:90
本文介绍了视网膜和非视网膜显示的支持图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我应该如何继续在视网膜和非视网膜显示器上正确支持图形?我有一个尺寸为640 * 920的背景图像,我认为它是用于视网膜显示的.但是我将如何支持尺寸为320 * 480的非视网膜显示器?您如何构造图形资源?我有一个名为"Art"的组,具有所有图形(现在全部用于视网膜显示尺寸). ios会自动将我的图形缩小到非视网膜显示吗?我还有一个查询,例如我将一个按钮拖到某个绝对位置的视图上以进行视网膜显示,它会自动调整到尺寸为320 * 480的设备上的适当位置吗?我可以在如何同时支持屏幕尺寸/分辨率方面获得一些好的在线提示吗?我尚未在Google上找到正确的信息.

I wanted to know that how should i proceed to support graphics properly on both retina and non-retina display ? I have a background image of dimension 640 * 920, i think it is for retina display. But i how would i go for supporting non retina display having dimension 320*480 ? How do you structure your graphics resources ? I have group called "Art" having all graphics (right now all for retina display dimension). Will ios automatically scale down my graphics to non - retina display ? I had one more query, like i am dragging one button to a view on some absolute position for retina display, will it automatically adjust to appropriate position on devices having dimension 320 * 480 ? can i have some good online tips on how to deal with supporting both screen dimensions/resolution ? I havent found proper info on google yet.

注意:我正在使用Xcode 4.3.3和情节提要.

Note: I am using Xcode 4.3.3 and using storyboards.

Gracias.

推荐答案

您必须为每个图像制作两个版本.例如,如果您有一个用于视网膜的544x151图像,说它的名称为"background@2x.png",则为非视网膜显示制作一个272x75的版本,即为"background.png"

You must make two versions of each image. For example, if you had a 544x151 image for retina, say its called 'background@2x.png', make a 272x75 version for non retina display, which would be 'background.png'

以后缀"@ 2x.png"命名所有视网膜图像.操作系统将在视网膜设备上自动显示@ 2x图像.因此可以得出结论:

Name all retina images with the suffix "@2x.png". The OS will automatically present the @2x images on retina devices. So to conclude:

272x75为"background.png" 544x151为"background@2x.png"

272x75 would be "background.png" 544x151 would be "background@2x.png"

这也是使图标与视网膜设备兼容的正确方法.只需制作一个114x114(iphone)或144x144(ipad)并将其命名为"icon@2x.png"即可.

This also is the correct way to make icons compatible with retina devices. Just make a 114x114 (iphone) or 144x144 (ipad) and name it "icon@2x.png".

这篇关于视网膜和非视网膜显示的支持图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆