iPhone应用程序转换为iPad? [英] iPhone app converting to iPad?

查看:198
本文介绍了iPhone应用程序转换为iPad?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的应用转换为通用应用。有人可以推荐一些很好的教程来实现这一目标吗?

I want to convert my app to a Universal app. Can anyone recommend some good tutorials for achieving this?

我需要将Interface Builder中的每个View作为单独的iPhone或iPad视图。

I need to have each View in Interface Builder as a separate, view for iPhone or iPad.

谢谢提前!

推荐答案

我只是手动执行此操作,大致使用以下步骤:

I just did this mostly manually, using approximately the following steps:

在Interface Builder中加载应用程序的主窗口xib,使用IB菜单创建iPad版本将其转换为iPad版本,并以适当的名称保存(-iPad.xib后缀为常见。)

Load the app's main window xib in Interface Builder, use the IB menu "Create iPad Version" to convert it to an iPad version, and save it under an appropriate name (a "-iPad.xib" suffix is common.)

在Xcode中,将这个新的.xib文件添加到项目中并将其包含在应用程序的目标中。

In Xcode, add this new .xib file to your project and include it in the app's target.

修改应用程序的Info.plist,在NSMainNibFile~ipad键下命名这个新的ipad xib。

Modify the app's Info.plist to name this new ipad xib under the "NSMainNibFile~ipad" key.

将Build target设置更改为iPhone / iPad目标设备。

Change the Build target setting to say iPhone/iPad as the targeted device.

添加运行时代码检查,例如:

Add run-time code checks such as:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { ... }

处理任何程序设计创建UI或绘图差异,选择iPhone与iPad xibs等。

to handle any programmatically created UI or drawing differences, select iPhone versus iPad xibs, etc.

添加适当的图标大小,默认图像等。

Add appropriate icon sizes, default images, etc.

重新设计您的视图以选择性地显示更多内容,自动调整以支持更多轮换,使用弹出式窗口等。

Redesign your views to optionally display more stuff, autoresize to support more rotations, use popovers, etc.

这篇关于iPhone应用程序转换为iPad?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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