如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行? [英] How can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4?

查看:20
本文介绍了如何以编程方式确定我的应用程序正在 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 上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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