Prefer Large Titles and RefreshControl not working well

后端 未结 11 2146
野性不改
野性不改 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-29 05:42

    It seems there are a lot of different causes that could make this happen, for me I had a TableView embedded within a ViewController. I set the top layout guide of the tableview to the superview with 0. After all of that still nothing until I wrapped my RefreshControl end editing in a delayed block:

    DispatchQueue.main.async {
       if self.refreshControl.isRefreshing {
           DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: {
                self.refreshControl.endRefreshing()
           })
       }
    }
    

提交回复
热议问题