开发者

Presenting modal view controller makes its tableview move down little by little

开发者 https://www.devze.com 2022-12-30 22:07 出处:网络
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开发

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消