UIImageView中的视网膜/非视网膜图像 [英] Retina/non-retina images in UIImageView

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

问题描述

我的应用程序中有一个300 x 300大小的UIImageView,它可以很好地显示我的图像。我的图像都是600 x 600或更大,UIImageView只是为我调整大小。

I have a 300 x 300 sized UIImageView in my app which is displaying my images very nicely. My images are all 600 x 600 or larger and UIImageView simply resizes them for me.

我的问题是:因为这些图像基本上都是视网膜图像(即双倍所需像素大小)制作同一图像的视网膜和非视网膜版本有什么意义吗?这不会因为额外的图像文件而使我的应用更大吗?

My question is this: as these images are essentially all retina images anyway (i.e. double the required pixel size) is there any point in making a retina and a non-retina version of the same image? Won't this just make my app bigger because of the extra image files?

让设备缩小图像有什么问题?我确定有一个非常好的答案,所以我想知道它是什么!

What's wrong with just letting the device downscale the images? I'm sure there's a very good answer so I'd like to know what it is!

感谢您的建议。

推荐答案

对于我们的应用程序,我们使用@ 2x图像的组合并按照您的建议进行缩放。我们使用@ 2x图像作为条形按钮,图标等。但对于UIImageViews,我们通常只使用Scaling。

For our apps we use a combination of the @2x images and doing what you've suggested, Scaling. We use the @2x images for bar buttons, icons, etc. But for UIImageViews we often just use the Scaling.

这篇文章暗示了两者: http://mobile.tutsplus.com/tutorials/iphone /准备你的iphone-app-for-higher-resolution /

Here is an article that suggests both: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/

忽略关于不支持@ 2x的iPad的部分(这是旧信息)但这篇文章仍然很好。

Ignore the part about the iPad not supporting @2x (that is old information) but the article is still good.

这样做可能会有性能影响,但对于大多数应用程序,我认为这可以忽略不计。文件大小的节省有时会使扩展成为唯一的选择。

There can be a performance hit for doing this, but for most apps I'd say this is negligible. The savings in file size sometimes make scaling the only option.

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

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