我知道有一些这样的问题,但我没有解决方案。我试图了解它是否是 iPhone 6。
#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)
当我尝试这个时,即使在 iPhone 6 中它返回 IS_IPHONE_5 也是真的。如果我尝试 native.scale iphone 5 和 6 也返回 2,只有 iphone 6 plus 返回 3。所以如果从高度或从比例来看它是 iphone 6,我无法得到它.
NSStringFromCGRect(mainScreen.bounds), mainScreen.coordinateSpace, mainScreen.scale, mainScreen.nativeScale);
它们在 iPhone 5 和 iPhone 6 中都返回相同的结果。那么如何检测呢?请提供任何帮助。