【问题标题】:Retina graphics vs non-retina graphics managementRetina 图形与非 Retina 图形管理
【发布时间】:2012-08-30 11:35:47
【问题描述】:

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

有很多关于这个的帖子,但仍然有一些我不完全理解的东西。

我正在阅读“amatn”的这句话:

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?

【问题讨论】:

    标签: objective-c xcode ios-simulator retina-display


    【解决方案1】:
    1. 我是否应该只在视网膜模拟器上进行测试,就好像我在非视网膜上放置一个@2 grapic 会太大? ...或者还有其他 怎么做?

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

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

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

    1. 带有图像的自定义按钮怎么样?我应该如何处理这些?
    [myButton setImage:[UIImage imageNamed:@"myFileName"]]; 
    

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

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

    是的,包括多种图像分辨率的常见做法,iPhone 应用程序(不确定 iPad)需要包含视网膜和非视网膜图像。但无论要求如何,您都绝对应该支持这两种设备分辨率,以让您的客户满意!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-21
      • 1970-01-01
      • 2013-04-02
      • 2016-07-21
      • 1970-01-01
      相关资源
      最近更新 更多