How can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4?(如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行?)
问题描述
我刚刚使用 cocos2d 完成了我的 iPhone 游戏.但在将它放到 AppStore 之前,我想让它在 iPad(屏幕更大)和 iPhone 4(分辨率更大)上运行.
那么,如何以编程方式确定我的应用程序在 iPhone、iPad 或 iPhone 4 上运行,以便能够在我的游戏中使用正确的坐标/图像?
I just finish my iPhone game using cocos2d. But before I put it on the AppStore, I'd like to make it work on iPad (which have a bigger screen) and iPhone 4 (which have a bigger resolution).
So, how can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4, to be able to use the correct coordinates / images in my game?
感谢您的帮助!
推荐答案
iPad 和 iPhone 之间 — 已经 已回答 许多 次.
iPhone 和 iPhone 4 之间 - 报告的尺寸仍然 320×480,因此您无需更改任何坐标.如果您需要高分辨率的 UI 图像,请为图像创建一个 @2x
替代方案.
Between iPhone and iPhone 4 — The size reported is still 320×480, so you don't need to change anything about the coordinates. Create an @2x
alternative for the images if you need a high resolution UI image.
这篇关于如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行?


基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01