iOS 6 - 区分iPhone 5和其他设备? [英] iOS 6 - Distinguishing between iPhone 5 and other devices?

查看:131
本文介绍了iOS 6 - 区分iPhone 5和其他设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着iPhone 5和新iPod的宣布,我开始优化我的应用程序,以利用新的额外屏幕空间。我已经到了我的应用程序不再是letterboxed的地步了。我知道现在还早,但是有谁知道如何区分新的,更高的设备和旧设备?

With the announcement of the iPhone 5 and new iPods today, I'm starting work on optimizing my app to take advantage of the new, extra screen space. I've already got to the point where my app isn't "letterboxed" anymore. I know it's early, but does anyone know how I could distinguish between the new, taller devices and the old ones?

理想情况下,它会是这样的:

Ideally, it would be something like this:

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今天宣布的内容!

Thanks! I hope everyone else is also enjoying what Apple announced today as well!

推荐答案

在我的头脑中,您可以使用边界UIScreen的信息
[UIScreen mainScreen] .bounds 并检查高度或更好的屏幕比例。

On the top of my head, you can use bounds information for the UIScreen [UIScreen mainScreen].bounds and check the height or better the ratio of the screen.

这篇关于iOS 6 - 区分iPhone 5和其他设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆