I have an auto-layout (constraint) based application and noticed that there is a problem with a tableview after an orientation change. The repro steps are as follows (I have a very basic repro app - with a tableview and an add button that adds a new item).
- Rotate your application to Landscape mode so the tableview is now landscape.
- Add an item to the tableview see 1 below
- Rotate back to Portrait, the tableview will now float on horizontal pan (as though the scroll viewer content size is landscape), see [2]
1 Code to add
- (IBAction)onAdd:(id)sender {
count ++;
[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:count-1 inSection:0]] withRowAnimation:UITableViewRowAnimationBottom];
}
[2] Floating table view
Any ideas on how to work around this problem? Also, how can I tell if this is known issue or something I should report to Apple?