有没有办法检测您的 iPhone 应用程序在 iPad 上运行 2x/1x?
我需要能够检测我的应用程序每英寸点数的差异。
检查scale
财产:
[[UIScreen mainScreen] scale]
这是一个方便的功能:
+(BOOL) screenIs2xResolution {
return 2.0 == [MyDeviceClass mainScreenScale];
}
+(CGFloat) mainScreenScale {
CGFloat scale = 1.0;
UIScreen* screen = [UIScreen mainScreen];
if ([UIScreen instancesRespondToSelector:@selector(scale)]) {
scale = [screen scale];
}
return scale;
}
学分:http://www.markj.net/iphone-4-2x-graphics-scale-ipad/ http://www.markj.net/iphone-4-2x-graphics-scale-ipad/
也可以看看:http://struct.ca/2010/high-res-graphics-in-cocos2d/ http://struct.ca/2010/high-res-graphics-in-cocos2d/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)