UITableView inside a Navigation Controller does no

2019-09-15 03:34发布

问题:

I am showing a Modal Presentation View in a Navigation Controller by calling

[self.navigationController presentViewController:controllerA animated:YES completion:nil];

And I am dismissing the controllerA by calling

[self.presentingViewController dismissViewControllerAnimated:YES completion:nil]

After the dismiss is done the UITableView in in the previous navigationController does not scroll up and down where as it did before the presentViewController was called. Do I need to do something after dismiss to make the UITableView scroll again.

回答1:

The problem was that I had a Header View in the UITableView and I needed to uncheck the "Use Autolayout" (in the File Inspector section) from the Xib file as I was loading the Header from a Xib.

Unexpected scroll behavior after adding rows to UITableView