Weird uitableview behaviour in iOS11. Cells scroll up with navigation push animation

前端 未结 12 1456
粉色の甜心
粉色の甜心 2021-01-29 18:34

I have recently migrated some code to new iOS 11 beta 5 SDK.

I now get a very confusing behaviour from UITableView. The tableview itself is not that fancy. I have custo

12条回答
  •  太阳男子
    2021-01-29 19:08

    This is due to UIScrollView's (UITableView is a subclass of UIScrollview) new contentInsetAdjustmentBehavior property, which is set to .automatic by default.

    You can override this behavior with the following snippet in the viewDidLoad of any affected controllers:

        tableView.contentInsetAdjustmentBehavior = .never
    

    https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior

提交回复
热议问题