I have very simple iPhone app, which uses just UIButtons
, UIlabels
, UITableView
. without any custom controllers and graphics. How can I convert app to universal with that UI?
我有一个非常简单的iPhone应用,它只使用UIButtons UIlabels UITableView。没有任何自定义控制器和图形。如何用这个UI将app转换成universal呢?
2 个解决方案
#1
21
First update the application target device to Universal.
首先将应用程序目标设备更新为Universal。
- Update the application target device to Universal.
- 将应用程序目标设备更新为Universal。
- Check the Info.plist for
NSMainNibFile
&NSMainNibFile~ipad
keys. - 检查信息。NSMainNibFile和NSMainNibFile的plist ~ipad键。
- For all other views, have two different NIB. For example FirstView.xib & FirstView~ipad.xib. iOS runtime will load the proper view based on the device.
- 对于所有其他视图,有两个不同的NIB。例如FirstView。xib & FirstView ~ ipad.xib。iOS运行时将根据设备加载正确的视图。
Here is a screenshot of a sample project:
下面是一个示例项目的屏幕截图:
#2
1
I needed to convert my iPhone App to iPad yesterday and found the easiest way to do it as long as your app is pretty simple. Mine was literally just some tableViews that were set to auto-size. In Targets / Devices just change it from 'iPhone' to 'Universal' and then build your application. This worked very nicely for me. All tableViews were perfectly formatted for the iPad and that is really all I needed.
昨天我需要把我的iPhone应用程序转换成iPad,找到了最简单的方法,只要你的应用程序非常简单。我的视图只是一些设置为自动大小的表视图。在target /设备中,只需将其从“iPhone”更改为“Universal”,然后构建应用程序。这对我来说效果很好。所有的tableview都被完美地格式化了,这就是我所需要的。
Note that if you had any other XIB files that were not just tableViews, such as a window with text fields, all you have to do is set them each to resize properly so they stretch and stay at the top and your simple app should be pretty much all set for the iPad.
请注意,如果你有任何其他XIB文件不仅tableview,如一个窗口文本字段,你所要做的就是让他们每个正常调整所以她们伸伸懒腰,呆在顶部和你的简单的应用程序应该是几乎所有的iPad。
Obviously you'll need to test it and tweak anything needed but for the most part the above worked magically for me and took literally one second to convert my iPhone app to an iPad app!
显然,你需要对它进行测试和调整,但在大多数情况下,上述方法对我来说都是神奇的,我花了一秒钟时间将我的iPhone应用程序转换成iPad应用程序!
#1
21
First update the application target device to Universal.
首先将应用程序目标设备更新为Universal。
- Update the application target device to Universal.
- 将应用程序目标设备更新为Universal。
- Check the Info.plist for
NSMainNibFile
&NSMainNibFile~ipad
keys. - 检查信息。NSMainNibFile和NSMainNibFile的plist ~ipad键。
- For all other views, have two different NIB. For example FirstView.xib & FirstView~ipad.xib. iOS runtime will load the proper view based on the device.
- 对于所有其他视图,有两个不同的NIB。例如FirstView。xib & FirstView ~ ipad.xib。iOS运行时将根据设备加载正确的视图。
Here is a screenshot of a sample project:
下面是一个示例项目的屏幕截图:
#2
1
I needed to convert my iPhone App to iPad yesterday and found the easiest way to do it as long as your app is pretty simple. Mine was literally just some tableViews that were set to auto-size. In Targets / Devices just change it from 'iPhone' to 'Universal' and then build your application. This worked very nicely for me. All tableViews were perfectly formatted for the iPad and that is really all I needed.
昨天我需要把我的iPhone应用程序转换成iPad,找到了最简单的方法,只要你的应用程序非常简单。我的视图只是一些设置为自动大小的表视图。在target /设备中,只需将其从“iPhone”更改为“Universal”,然后构建应用程序。这对我来说效果很好。所有的tableview都被完美地格式化了,这就是我所需要的。
Note that if you had any other XIB files that were not just tableViews, such as a window with text fields, all you have to do is set them each to resize properly so they stretch and stay at the top and your simple app should be pretty much all set for the iPad.
请注意,如果你有任何其他XIB文件不仅tableview,如一个窗口文本字段,你所要做的就是让他们每个正常调整所以她们伸伸懒腰,呆在顶部和你的简单的应用程序应该是几乎所有的iPad。
Obviously you'll need to test it and tweak anything needed but for the most part the above worked magically for me and took literally one second to convert my iPhone app to an iPad app!
显然,你需要对它进行测试和调整,但在大多数情况下,上述方法对我来说都是神奇的,我花了一秒钟时间将我的iPhone应用程序转换成iPad应用程序!