问题适应iPad x2兼容模式的比例因子 [英] Problem adapting scale factor for iPad x2 compatibility mode

查看:76
本文介绍了问题适应iPad x2兼容模式的比例因子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以帮助我跟进。我编写了一个Quartz 2d ap,并使用以下代码为每个设备获得正确的比例因子:

I wonder if anyone can help me with following. I have written a Quartz 2d ap and have used the following code to get the correct scale factor for each device :

if ([UIScreen instancesRespondToSelector:@selector(scale)])
{
        return [[UIScreen mainScreen] scale];
}
else
{
        return 1.0;
}

然后我将所有值乘以我的代码中的这个比例mulitplier。我遇到的问题是应用程序在ipad上没有在x2模式下显示属性 - 一切都是两倍大。有人可以帮帮我吗?

I then multiply all values by this scale mulitplier in my code. The problem I have is that the app does not display propertly in x2 mode on the ipad - everything is two times too big. Can anybody help me ?

谢谢,

Martin

推荐答案

比例因子与较新的iPhone和iPod touch上的Retina显示有关,而不是iPad上的2X缩放设置。实际上,您引用的UIScreen scale 属性在iPad目前的3.2操作系统版本中不存在,仅在4.0+上。在当前运行OS 4.2测试版的iPad上,应始终返回1.0。

The scale factor is related to the Retina displays on the newer iPhones and iPod touches, not the 2X scaling setting on the iPad. In fact, the UIScreen scale property you are referencing does not exist on the iPad's current 3.2 OS version, only on 4.0+. On the current iPads running the OS 4.2 beta, it should always return 1.0.

问题您遇到的情况,在2X模式下使用Quartz绘图必须来自其他地方。您是否对代码中的任何元素进行了特定于设备的检查?

The problem you are experiencing with Quartz drawing in the 2X mode must come from somewhere else. Do you do any device-specific checks for any elements in your code?

这篇关于问题适应iPad x2兼容模式的比例因子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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