This is Portrait:
This is Landscape
I've tried this on rotation with no success:
self.tableView.autoresizesSubviews = YES;
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
This is Portrait:
This is Landscape
I've tried this on rotation with no success:
self.tableView.autoresizesSubviews = YES;
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
I looks like the table view is scrolled down a little after the orientation change.
Have you tried calling scrollToRowAtIndexPath:atScrollPosition:animated:
and scrolling to the top-most row?
This problem can occur if you've called "willAnimateRotationToInterfaceOrientation:" in your navigation controller, but forgotten to call super from within the method.
You should have something like this:
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation];
// Your code here
}
I ran into this problem recently. In my case, it was because I was performing rotations of a navigation controller that was not the root controller of the application window. I was therefore using the rotate notification listener/affine transform/bounds adjustment approach to changing the layout of the navigation controller. This worked all right but produced the results described here. It took me a while to notice that when I rotated to landscape the nav bar's height was not being correctly resized (i.e., from 44 to 32 pixels, the framework's reduced height for landscape mode). The root view controller of my app was responding to willRotateToInterfaceOrientation and didRotateFromInterfaceOrientation, however. That view controller also already knew about the associated navigation controller. I remedied the problem by adding the following code to the willRotateToInterfaceOrientation method:
CGRect frame = self.navViewController.navigationBar.frame;
if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
frame.size.height = 44;
} else {
frame.size.height = 32;
}
self.navViewController.navigationBar.frame = frame;
Hope this saves somebody some time in a similar situation.