I think this is a mistake; if you convert the project away from the automatic layout and set the appropriate masks for resizing, everything works fine. You should indicate a mistake, especially because you have a simple sample project that reproduces it beautifully.
What happens in your case, just as you suspected - viewing the contents of the scroll view remains at the width of the landscape, even if the view itself has changed to a portrait, so that you suddenly get the option of horizontal drag and drop.
Fortunately, there are fairly simple workarounds. I experimented with various combinations of setNeedsLayout or setNeedsUpdateConstraints without success, but you can implement one of these two solutions:
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { [self.tableView beginUpdates]; [self.tableView endUpdates]; }
Or,
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { CGSize contentSize = self.tableView.contentSize; contentSize.width = self.tableView.bounds.size.width; self.tableView.contentSize = contentSize; }
jrturton Jan 20 '13 at 20:38 2013-01-20 20:38
source share