Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIRefreshControl and UITableView's backgroundVIew

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 control is invisible. If I remove the background view, I can see the refresh control.

Am I doing something wrong?

like image 797
leftspin Avatar asked Sep 19 '13 19:09

leftspin


1 Answers

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.

like image 161
Champoul Avatar answered Nov 18 '22 07:11

Champoul