我即将推出一个新的应用程序,并希望提高图形的质量。在我的例子中,图形是徽标和自定义按钮。我不知道这是否会影响核心情节,但这也是包的一部分。
有相当多的帖子关于这一点,但仍然有一些事情我不完全理解。
我正在读“amattn”中的这句话:
It's trivial:
1.Only include @2x images in your project.
2.Make sure those images have the @2x suffix.
The system will automatically downscale for non-retina devices.
The only exception is if you are doing manual, low level Core Graphics drawing.
You need to adjust the scale if so. 99.9% though, you don't have to worry about this.来自这篇文章:Automatic resizing for 'non-retina' image versions
我对此的问题是:
1. Should i do the testing on retina simulator only, as if i place a @2 grapic on
non-retina it will be too big? ...or is there an other way of doing it?
2. Should i always use a ImageView or is it OK to drag the image on the screen,
this is the logo i am talking about?
3. What about custom made buttons with images, how should i do with those?
4. What is the normal process to manage the different screen sizes, do people
add images for all displays or using this type of process?发布于 2012-08-30 20:41:34
你在哪个模拟器上测试并不重要,因为只要你的非视网膜和视网膜图形命名正确(image和image@2x),正确的图像就会自动显示出来。
当您从项目中直接拖动图像到界面构建器中的一个视图上时,您并没有真正看到它的发生,但它会自动创建包含您放入的图像的图像视图。
[myButton setImage:[UIImage imageNamed:@"myFileName"]]; 如上面的代码所示,当引用UI元素应该使用的图像时,应该始终使用非视网膜fle名称。也就是说,如果iOS检测到设备是视网膜,它可以自动使用@2x版本来代替它。
是的,包括多图像分辨率的常见做法,这是iPhone应用程序(对iPad不确定)同时包括视网膜和非视网膜图像所必需的。但是不管什么要求,你绝对应该支持这两种设备的分辨率,以使你的客户满意!
https://stackoverflow.com/questions/12195996
复制相似问题