使应用程序对 Retina 显示屏友好
我有一个应用程序,希望使其适合视网膜显示。
这个过程到底是如何进行的?除了我已有的图像之外,还需要添加哪些图像?
我知道尺寸应该不同,但不确定细节?
还需要做什么来处理视网膜显示?
如果设备支持视网膜显示,是否应该检测设备并使用其他图像?
如果有很多图像怎么办?这将如何影响应用程序的大小?
谢谢
I have an app and would like to make it retina display friendly.
How exactly does the process work? What images need to be added apart from what I have?
I know the sizes should be different, but am not sure on the details?
What else needs to be done to handle retina display?
Should the device be detected and use other images if the device supports retina display?
What if there are a lot of images? And how will this effect the app size?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可以在这里找到一个很好的指南: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
一般来说,您只需创建 2 组图像。你原来的,然后是两倍大的新的,名称中带有@2x。因此,对于尺寸为 32x32 的 image.png,您将得到一个分辨率两倍的 [email 受保护],尺寸为 64x64。在您的应用程序中,始终在 Interface Builder 中以及在代码中加载时使用 image.png。
无需检测设备。这些图像将由操作系统自动拾取并根据需要进行替换。
A good guide to this can be found here: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
In general you just create 2 sets of images. Your original and then a new one twice as big with @2x in the name. So for image.png at size 32x32 you would have one that is twice the resolution called [email protected] at size 64x64. In your app just always use the image.png in Interface Builder and when loading in code.
There is no need to detect the device. These images will automatically be picked up by the OS and subbed in as necessary.
如果您使用精灵
http://weedygarden.网/2012/04/hi-res-retina-display-css-sprites/
good articles if you're using sprites
http://weedygarden.net/2012/04/hi-res-retina-display-css-sprites/
使用视网膜图像的主要内容是图像名称约定。
并且图像的大小应该是常规图像的2倍。
示例-如果您的常规图标名称是 icon.png 那么它应该是 [email protected] 对于
视网膜。第二件事是常规尺寸为 72*72,那么视网膜尺寸应为 144*144。
这可能对你有帮助。
谢谢
The main thing about working with retina image is that image name convention.
And the size of image should be 2times greater than regular1.
Example- if your icon name for regular is icon.png then it should be [email protected] for
retina.And second thing is size for regular is 72*72 then it should be 144*144 for Retina.
It might be helpful for you.
Thnks