Xcode 4.2, change iPhone xib to iPad xib

I created a project consisting of 5 xib. When I try to run a project in an iPad simulator. Some of the Xibs come in iPhone screen sizes. I want to convert those iphone xibs that will support the Xib X iPad screen size. Any idea how to do this?

NOTE. I want to support both iPhone and iPad.

+5
source share
5 answers

I just copied the old Xib and renamed it as ~ ipad for the last time. And in the source code, instead of 320 * 480, I replaced the resolution of the iPad. And my ie interface interface looks like an iPad, and my application detects ipad xib. Thanks for everyone.

+1
source

You can convert iPhone xib to iPad xib using the next step.

( xcode) Open As > Source Code

     

:

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

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

"IBCocoaTouchFramework" "IBIPadFramework"

     

> Builder - iOS

al xib... iPhone xib iPad xib.

, .

+18

, .

 if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
            self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
        } else {
            self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
    }
+1

ipad xib .

+1

:

Make a copy of .xib in Finder. Open the copied file in a text editor. Change "com.apple.InterfaceBuilder3.CocoaTouch.XIB" to "com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB. Change all instances of "IBCocoaTouchFramework" to "IBIPadFramework". Find sizes such as {480, 320} and edit them. Or simply open the file in Xcode and use the graphical interface to resize the elements as needed. This also works the other way around if you need to change iPad xib to iPhone xib.

0
source

All Articles