1

我从事图像缩放工作。如何确定应用程序是否在 iphone 5 上运行?需要知道屏幕高度是960还是1136..

4

3 回答 3

3
#define IS_IPHONE5 ([[UIScreen mainScreen] bounds].size.height == 568)

if (IS_IPHONE5) {
    NSLog(@"iPhone 5");
} else {
    NSLog(@"iphone 4s or lower");
}
于 2012-10-24T20:30:36.003 回答
2

检查屏幕高度

int height =  [[UIScreen mainScreen] bounds].size.height;
if(height > 480){
    NSLog(@"iPhone 5");
}
else{
    NSLog(@"iPhone 4, 4s....");
}
于 2012-10-24T19:51:45.250 回答
0

您可能想用来+[UIScreen mainScreen]获取屏幕尺寸。

于 2012-10-24T19:43:55.677 回答