随着今天 iPhone 5 和新 iPod 的发布,我开始着手优化我的应用程序以利用新的、额外的屏幕空间。我已经到了我的应用程序不再“信箱化”的地步。我知道现在还早,但有谁知道我如何区分新的、更高的设备和旧设备?
理想情况下,它应该是这样的:
if (device is iPhone 5 or taller iPod touch) {
do stuff that is ideal for the taller screen
} else {
do what I've been doing before for the smaller screen
}
谢谢!我希望其他人也喜欢 Apple 今天发布的内容!
最佳答案
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone Classic
}
if(result.height == 568)
{
// iPhone 5
}
}
关于iphone - iOS 6 - 区分 iPhone 5 和其他设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12398798/