Reputation: 881
I developed an iPhone app and want to extend this app for the iPad. Therefore I copied the XIBs and changed the document type from com.apple.InterfaceBuilder3.CocoaTouch.XIB
to com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB
and named the XIBs as follows: "UIFile.xib" as "UIFile~iPad.xib" …
Now I tried to change the size from the views inside the attribute inspector from "iPhone" to "iPad Full Screen". It worked for the launch screen, but not for the localized XIBs. I can change the values directly in the source code, but it has no affect for the graphical view inside the Interface Builder. They just have the same sizes as for the iPhone XIBs. Now it is difficult to place the view components like buttons at new position.
How can I resize the View to "iPad Full Screen"?
Upvotes: 0
Views: 121
Reputation: 1480
You can use in each class
- (void) viewDidLayoutSubviews
{
if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad) {
CGRect viewBounds = self.view.bounds;
CGFloat topBarOffset = self.topLayoutGuide.length;
viewBounds.origin.y = topBarOffset * -1;
self.view.bounds = viewBounds;
}
}
Upvotes: 1
Reputation: 881
Think I have to use the Size Classes. After activating the Size Classes it is possible.
Upvotes: 0