Xcode 4: how to convert XIB for iPhone to for iPad

Source: Internet
Author: User
In xcode 3. X, convert XIB from iPhone to IPAD through the create iPad version menu.

However, in xcode 4.x, this menu cannot be found. After some exploration, I found that XIB can be converted into an iPad using the following method.

1. Modify the XIB source file

The XIB file is actually an XML file. You can edit and modify it as text. In project navigator, right-click the XIB file and select "open as-> source code ".Source codeView the XIB file and find "com. apple. interfacebuilder3.cocoatouch. change the XIB line to "com. apple. interfacebuilder3.cocoatouch. iPad. XIB ", that is, in ". XIB "insert ". iPad ".

Press replace + F to open the search box and click replace to change the replace mode. Replace all "ibcocoatouchframework" in the XIB file with "ibipadframework.

Press seconds + S to save the changes.

2. Modify the XIB view size.

Right-click the XIB file, select "open as-> interface builder-Ios", and open it in IB mode.

Select the Root View (uiview) in the xib file, find the size option on the property panel, and change it to full iPad screen.

Now you can have an iPad version of XIB.

However, in xcode 4.x, this menu cannot be found. After some exploration, I found that XIB can be converted into an iPad using the following method.

1. Modify the XIB source file

The XIB file is actually an XML file. You can edit and modify it as text. In project navigator, right-click the XIB file and select "open as-> source code ".CodeView the XIB file and find "com. apple. interfacebuilder3.cocoatouch. change the XIB line to "com. apple. interfacebuilder3.cocoatouch. iPad. XIB ", that is, in ". XIB "insert ". iPad ".

Press replace + F to open the search box and click replace to change the replace mode. Replace all "ibcocoatouchframework" in the XIB file with "ibipadframework.

Press seconds + S to save the changes.

2. Modify the XIB view size.

Right-click the XIB file, select "open as-> interface builder-Ios", and open it in IB mode.

Select the Root View (uiview) in the xib file, find the size option on the property panel, and change it to full iPad screen.

Now you can have an iPad version of XIB.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.