Reputation: 719
I'm trying to create a book reading application on IOS/Xcode4.6 and I created a UIPageViewController. The application is for iPads and it'll always be on landscape mode, so I'm displaying two UIViewControllers at once.
all working fine, but i need to reduce the size of the book as it takes the full screen to display the pages. When i try to resize the view, the content of the UIViewControllers represented as book pages goes out of the book.
This is what i need the interface to look like. Please help. thanks in advance.
Upvotes: 3
Views: 1769
Reputation: 719
Phew, found the solution after few search cycles. It may not be the best way of doing it but then here's what I did, pretty simple.
I set my pages' (UIViewControllers) view with an autoresizing mask inside init;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
}
return self;
}
Upvotes: 1