I have a simple page with a nav bar at the top, tab bar at the bottom, and a scrollview filling the space between. The scrollview contains a label and image and a non-scrollable textview that gets dynamically filled with text and sized appropriately. I've been trying to make it work in landscape by using:
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
NSLog(@"called");
navBar.frame = CGRectMake(0, 0, 480, 32);
sview.frame = CGRectMake(0, 32, 480, 240);
}
else {
navBar.frame = CGRectMake(0, 0, 320, 44);
sview.frame = CGRectMake(0, 44, 320, 372);
}
}
This gets me very close as the nav bar and scrollview resize correctly and it scrolls nicely, but the content within the scrollview is off to the left. How do I redraw the contents to line up correctly within the scrollview?