I have created the project which consists of 5 xibs. When I try to run the project in the iPad simulator . Some of the Xibs are coming in the iPhone screen size. I want to convert those iphone xibs which will support the iPad Xib screen size. Any idea how to do it ?
NOTE: I want to support both the iPhone and iPad
You can convert iPhone xib into iPad xib using following step.
Right click the file (in xcode) and Open As > Source Code
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">
Search for "IBCocoaTouchFramework" and Replace all occurrences with "IBIPadFramework"
Save the file and Open As > Interface Builder - iOS
you can do this for al xib...and you have your iPhone xib now in iPad xib.
Hope, this will help you..
I think it will be helpful to you
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];
}
Then you should create your project or update your project universal and change ipad xib setting and autoresize it.
I have just copied the old Xib and renamed it as ~ipad at the last. And in the source code instead of 320*480 I have replaced the iPad resolution. And my UI i.e interface builder looks like the iPad and my application is detecting the ipad xib's . Thanks for every one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With