My view is originally in landscape mode. when a button is taped, a view opens in portrait mode and everything is find upto this point. the problem is when I go back from that view to the root view the view won't rotate correctly. here is the code I use to rotate the view from portrait to landscape,
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
//rotate the page to lansscape
CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(-90*0.0174532925);
landscapeTransform = CGAffineTransformTranslate (landscapeTransform, 0.0, 0.0);
[self.navigationController.view setTransform:landscapeTransform];
self.navigationController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |UIViewAutoresizingFlexibleHeight;
self.navigationController.view.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height);
self.navigationController.view.center = CGPointMake (384.0, 544.0);
[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft;
}
here is a screen shot of the root page in landscape mode after returning from the portrait page,

this is how it should look like
