Reputation: 662
In my iPad application, i have used UISplitViewController
where master view contains table view while detail view holds UIViewController
. On button event detail view comes over master view, code is mentioned following. This code works fine on iPad 3.2 but not working on ios 4.2.
UIViewController *leftUIV = [appDelegate.splitViewController.viewControllers objectAtIndex:0];
UIViewController *rightUIV = [appDelegate.splitViewController.viewControllers objectAtIndex:1];
CGRect rectMaster = leftUIV.view.frame;
CGRect rectDetail = rightUIV.view.frame;
rectMaster.size.width = 0;
rectDetail.size.width = 1024;
rectDetail.origin.x = 0;
[leftUIV.view setFrame:rectMaster];
[rightUIV.view setFrame:rectDetail];
Please help, How should I solve it?
Upvotes: 0
Views: 3675
Reputation: 11148
Add this to your DetailViewController.m
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[self.view sizeToFit];
NSLog(@"ROTATE - self.view.frame = %@", NSStringFromCGRect(self.view.frame));
}
Upvotes: 0
Reputation: 662
Finally got the answer on site Click here
Thanks to - Alice Bevan and McGregor
Upvotes: 3
Reputation: 16337
I think you're trying to do something unsupported. You can't resize the splits: the sizes are fixed.
If you wanted to temporarily show only the detail view in landscape mode, perhaps you could remove the split view from the view hierarchy and add just the detail view instead, then swap them back when you're done?
Upvotes: 1