Converting iPhone xib to iPad xib?

后端 未结 17 2728
一向
一向 2020-11-27 09:31

How do you do it? I saw one video tutorial on it, but the screen was too small. Also, other than changing the view size, are there any other major changes I would have to

相关标签:
17条回答
  • 2020-11-27 09:58

    In addition to answer given by Jag also search for "320,460" and replace it with 768,1024 and your XIB will be resized to iPad dimensions.

    0 讨论(0)
  • 2020-11-27 09:59

    Assume you've the SDK with Xcode 3,

    1. Open IB.
    2. Open the XIB.
    3. File -> Create iPad version using autoresizing masks.
    0 讨论(0)
  • 2020-11-27 09:59
    Jag has given Great Answer.
    

    In Some Cases.

    No need to convert your Iphone XIB in Ipad XIB . You can Use Autoresizingmask and get Running Ipad also. just need to configure your APP for running in Universal mode with proper autoresizingmask.

    0 讨论(0)
  • 2020-11-27 10:04

    For Xcode 4,

    You need not create separate target for each device. Instead, you can change the Devices in project summary to Universal which would be in iPhone already. This is answered in the link Updating iOS 5 App to Universal on Xcode 4.2. Thus, it will do transition for you.

    0 讨论(0)
  • 2020-11-27 10:06

    I was able to narrow it down to a few things, so here are the steps that worked for me:

    1) Make a copy of the iPhone xib file and add it to your project

    2) Right click the file (in xcode) and Open As > Source Code

    3) The 2nd line should look like:

    <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
    

    Replace with:

    <archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
    

    4) Search for "IBCocoaTouchFramework" and Replace all occurrences with "IBIPadFramework"

    5) Save the file and Open As > Interface Builder - iOS

    The file might still look like a regular iPhone xib, but for me, once I changed the Status Bar to "Black" in the Attributes inspector the rest of the xib just kind of "snapped" into an iPad xib

    0 讨论(0)
  • 2020-11-27 10:10

    Xcode 4:

    The Create iPad Version Using Autosizing Masks feature has been removed from Xcode 4. Right now the easiest way is to use Xcode 3 for the conversion, since the nib (.xib) file format did not change.

    Xcode 3 & 4 can now be both installed on the same system by simply selecting a different folder (see installation instructions on the disk image).

    Otherwise you will need to copy/paste the UI elements from the iPhone version, and re-link them to your code.

    0 讨论(0)
提交回复
热议问题