Convert simple iPhone app to Universal app

≯℡__Kan透↙ 提交于 2019-11-26 20:29:31

问题


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?


回答1:


First update the application target device to Universal.

  1. Update the application target device to Universal.
  2. Check the Info.plist for NSMainNibFile & NSMainNibFile~ipad keys.
  3. 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.

Here is a screenshot of a sample project:




回答2:


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.

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.

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!



来源:https://stackoverflow.com/questions/5861330/convert-simple-iphone-app-to-universal-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!