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

前端 未结 12 1566
粉色の甜心
粉色の甜心 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:20

    In addition to maggy's answer

    OBJECTIVE-C

    if (@available(iOS 11.0, *)) {
        scrollViewForView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }
    

    This issue was caused by a bug in iOS 11 where the safeAreaInsets of the view controller's view were set incorrectly during the navigation transition, which should be fixed in iOS 11.2. Setting the contentInsetAdjustmentBehavior to .never isn't a great workaround because it will likely have other undesirable side effects. If you do use a workaround you should make sure to remove it for iOS versions >= 11.2

    -mentioned by smileyborg (Software Engineer at Apple)

提交回复
热议问题