Why is [[UIScale mainScreen] scale] 1 on an iPad 3 with Xcode 4.2?

懵懂的女人 提交于 2019-12-04 08:49:22

Before XCode version 4.3, [UIScreen scale] will return 1.0 for an iPad 3. Updating to 4.3 will enable the correct value of 2.0 being returned.

That's because the screen is not scaled. You can get the ratio like this:

[[CCDirector sharedDirector] winSize].width/[[CCDirector sharedDirector] winSizeInPixels].width

If this is equal to 1 then you are on a non-retina device. Otherwise , if 2 , on a retina display. Also , don't forget to enable retina support.

Regards,

George

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