为什么我的iPad Mini在iOS中表示屏幕尺寸错误? [英] Why is the scale representing screen size wrong in iOS for my iPad Mini?
问题描述
我有第一代iPad Mini(型号A1432 ),屏幕分辨率为1024x768(文档)。
I have a 1st generation iPad Mini (Model A1432) with a screen resolution of 1024x768 (documentation).
I在我的应用程序中有以下代码:
I have the following code in my app:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGFloat screenScale = [[UIScreen mainScreen] scale];
CGSize screenSize = CGSizeMake(screenBounds.size.width * screenScale, screenBounds.size.height * screenScale);
screenSize.height和screenSize.width报告:2048x1536,这是错误的。 screenScale的值是2,但我的理解是视网膜屏幕应该只有2,第一代iPad Mini不是。
screenSize.height and screenSize.width report: 2048x1536, which is wrong. The screenScale value is 2, but it is my understanding that it should only be 2 for retina screens, which the 1st generation iPad Mini is not.
任何想法为什么这可能发生了什么?我正在尝试在我的应用程序中使用代码来确定运行时的屏幕分辨率,因为我正在为增强现实应用程序进行像素操作。
Any ideas why this might be happening? I'm trying to have code in my app that determines the screen resolution at runtime, as I am doing pixel manipulation for an augmented reality app.
非常感谢任何帮助。
推荐答案
在评论讨论后......!
After a discussion in comments...!
如果您在iPad上运行仅限iPhone的应用程序,它将模拟视网膜设备并报告 2.0
的比例。我们知道(从上面开始!)iPad mini(gen 1)以及运行iOS 7的标准iPad 2也是如此。
If you run an iPhone only app on an iPad it will simulate a retina device and report a scale of 2.0
. We know (from the above!) that the iPad mini (gen 1) does this as well as the standard iPad 2 running iOS 7 would too.
这是。
This was introduced in iOS 7.
很值得注意!
这篇关于为什么我的iPad Mini在iOS中表示屏幕尺寸错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!