如何检测我的iPhone应用程序正在iPad上运行 [英] How to detect my iPhone app is being run on an iPad

查看:197
本文介绍了如何检测我的iPhone应用程序正在iPad上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在RetinaDisplay模式下呈现更好的opengl应用程序(双比例因子),我注意到iPad模拟了一个低分辨率屏幕的iPhone应用程序(正常比例因子)。

I have an opengl application that renders better in RetinaDisplay mode (double scale factor) and I noticed the iPad emulates an iPhone app with a low resolution screen (normal scale factor).

我想在iPhone上运行我的iPhone应用程序时将比例因子加倍,以便从Retina Display图形中受益。但似乎iPad真的很好伪造成iPhone(如果它只是一个Retina显示器那将是完美的......)

I want to double the scale factor when my iPhone app is run on an iPad, in order to benefit from Retina Display graphics. But it seems the iPad really well fakes being an iPhone (which would be perfect if only it was a Retina Display one...)

当我强制双倍时,它工作得很好(至少在模拟器中,我没有iPad可以测试)。

When I force the double scale, it works very well (at least in simulator, I do not have an iPad to test).

所以我需要一种方法来知道我是否在iPad上运行尽管很多事情告诉我它是一部旧iPhone。

So I need a way to know if I am run on an iPad despite many things telling me it to be an old iPhone.

或许我不应该尝试这样做?

Or maybe I should not try to do that ?

推荐答案

如果它是一个iPhone应用程序,那么你应该无法区分它,只要它可以告诉它在iPhone上运行。如果您想要定位iPad,那么您需要为iPad目标构建它。

you shouldn't be able to tell the difference, if its an iPhone app, then as far as it can tell it is running on an iPhone. if you want to target an iPad, then you need to build it for an iPad target.

这篇关于如何检测我的iPhone应用程序正在iPad上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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