UIRefreshControl and UITableView's backgroundVIew

前端 未结 4 1071
说谎
说谎 2021-02-01 03:39

I have a UITableViewController on which I set a backgroundView. This controller has a UIRefreshControl installed. The problem is that when I set a background view, the refresh c

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-01 03:50

    The reason for this behavior is that in iOS 7, the UITableView's backgroundView is drawn above the UIRefreshControl. Not sure if this is by design or an issue, but here is a workaround that fixed it for me :

       self.tableView.backgroundView.layer.zPosition -= 1;
    

    This code goes where you set up your UITableViewController refreshControl property.

提交回复
热议问题