Presenting modal view controller makes its tableview move down little by little
Dismissing/presenting a modal view controller which contains a tableview makes the table go down one row each time. Repeating presenting/dismissing pushes the table downwards out of the view in th开发者_如何学Pythone end.
How can I fix this?
In the end I fixed it.
This solves the problem:
tableView.contentInset = UIEdgeInsetsMake(44, 0, 0, 0);
The property is inherited from UIScrollView
and it specifies where the content of the scrollview (as tableview is a scrollview) should stay related to scroll's bounds.
精彩评论