Prefer Large Titles and RefreshControl not working well

后端 未结 11 2162
野性不改
野性不改 2020-12-29 05:09

I am using this tutorial to implement a pull-to-refresh behavior with the RefreshControl. I am using a Navigation Bar. When using normal titles eve

11条回答
  •  死守一世寂寞
    2020-12-29 06:00

    At the end what worked for me was:

    • In order to fix the RefreshControl progress bar disappearing bug with large titles:

      self.extendedLayoutIncludesOpaqueBars = true
      
    • In order to fix the list offset after refreshcontrol.endRefreshing():

      let top = self.tableView.adjustedContentInset.top
      let y = self.refreshControl!.frame.maxY + top
      self.tableView.setContentOffset(CGPoint(x: 0, y: -y), animated:true)
      

提交回复
热议问题