I am using splitviewcontroller with two main views and a detailed view in my ipad application. When changing the orientation of the ipad from portrait to landscape, I need to hide the main view and change the frame size of the detailed view so that it is displayed in full screen. For this, I use this code.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
UIViewController *master = [self.splitViewController.viewControllers objectAtIndex:0];
UIViewController *detail = [self.splitViewController.viewControllers objectAtIndex:1];
CGRect t = master.view.frame;
t.size.width = 0;
t.size.height = 0;
t.origin.x = 0;
t.origin.y = 0;
[master.view setHidden:YES];
[master.view setFrame:t];
CGRect f = detail.view.frame;
f.size.width = 1004;
f.size.height = 768;
f.origin.x = 0;
f.origin.y = 0;
[detail.view setFrame:f];
}
This code works exactly on ios3.2, but does not work for ios4.2. The master view is hidden in ios4.2, but the size of the detailed view size does not change.
Please help me. thanks shruti
Aisha source
share