Xcode 4 .xib Create iPad Version

2020-01-27 14:08发布

I have an iPhone xib I want to turn into an iPad xib. In Xcode 3 there was a "Create iPad Version" menu option. How do I do this in Xcode 4?

I currently resized my xib, but when I turn on the simulated items (Navigation Bar, etc.) it shrinks the view back down to iPhone size.

9条回答
走好不送
2楼-- · 2020-01-27 14:25

The 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).

查看更多
做个烂人
3楼-- · 2020-01-27 14:26

You will have to use the older version of Interface Builder to use the "Create iPad version using autoresizing masks". There currently is no option in Xcode 4 that will do this.

查看更多
Summer. ? 凉城
4楼-- · 2020-01-27 14:27

You can use this tool I made, based on the answer from "arlomedia":

http://iphone.dizzystudios.net/ConvertToiPad

just give it the iPhone xib path

查看更多
Fickle 薄情
5楼-- · 2020-01-27 14:33

Another simple way in XCode4 is: Just copy the iPhone XIB in Finder; drag the copy in your project. Open the copied XIB in XCodes build in interface builder. Change the size of the top view in your NIBs hirarchy to iPads dimensions (e.g. 1024x748 for landscape with statusbar) - everything else resizes according to the autoresizing masks. Works perfect for me.

查看更多
Summer. ? 凉城
6楼-- · 2020-01-27 14:35

in Xcode 4 it's quite hidden, but the option to convert XIBS in the app still exists.

Select the target (in XCODE4 it's shown when you select the project). Once selected use the contextual menu to "Duplicate" it. It will ask if you want to "Duplicate and transition to iPad". Then all the XIBS will be duplicated with the new iPad size.

查看更多
在下西门庆
7楼-- · 2020-01-27 14:36

If you make a new nib, it will ask you if it should be sized for iPad. That might be the easiest unless you've already done a bunch of work on it.

查看更多
登录 后发表回答