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

查看:183
本文介绍了如何以编程方式确定我的应用程序是在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天全站免登陆