首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >视网膜显卡与非视网膜显卡管理

视网膜显卡与非视网膜显卡管理
EN

Stack Overflow用户
提问于 2012-08-30 19:35:47
回答 1查看 615关注 0票数 1

我即将推出一个新的应用程序,并希望提高图形的质量。在我的例子中,图形是徽标和自定义按钮。我不知道这是否会影响核心情节,但这也是包的一部分。

有相当多的帖子关于这一点,但仍然有一些事情我不完全理解。

我正在读“amattn”中的这句话:

代码语言:javascript
复制
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

我对此的问题是:

代码语言:javascript
复制
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?
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-08-30 20:41:34

  1. 我应该只在视网膜模拟器上进行测试吗?如果我把@2图片放在非视网膜上会不会太大?...or有其他方法吗?

你在哪个模拟器上测试并不重要,因为只要你的非视网膜和视网膜图形命名正确(image和image@2x),正确的图像就会自动显示出来。

  1. 我应该始终使用ImageView,还是可以将图像拖到屏幕上,这就是我所说的徽标?

当您从项目中直接拖动图像到界面构建器中的一个视图上时,您并没有真正看到它的发生,但它会自动创建包含您放入的图像的图像视图。

  1. 带图片的自定义按钮怎么办?

代码语言:javascript
复制
[myButton setImage:[UIImage imageNamed:@"myFileName"]]; 

如上面的代码所示,当引用UI元素应该使用的图像时,应该始终使用非视网膜fle名称。也就是说,如果iOS检测到设备是视网膜,它可以自动使用@2x版本来代替它。

  1. 管理不同屏幕大小的正常流程是什么?人们是为所有显示器添加图像还是使用此类型的流程?

是的,包括多图像分辨率的常见做法,这是iPhone应用程序(对iPad不确定)同时包括视网膜和非视网膜图像所必需的。但是不管什么要求,你绝对应该支持这两种设备的分辨率,以使你的客户满意!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12195996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档