Problem adapting scale factor for iPad x2 compatibility mode

血红的双手。 提交于 2019-12-04 18:48:29
Brad Larson

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.

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?

I am not sure if this is your problem, but you seem to want to test the UIScreen for the selector scale. Which it will never have. That selector works only on [UIScreen mainScreen].

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

Although, this mistake would let you think that it would always return a scale of 1.0.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!