I have a tabular view inside UIViewController. I applied UIRefreshControlto tableView. If I dragged the table up while the update controller wheel is spinning, the first header is stuck in the middle of the table. I can’t understand what’s wrong ...
Here is a screenshot of the problem:

Here is the code I used in viewDidLoad:
refreshControl = UIRefreshControl()
refreshControl.tintColor = UIColor.redColor()
refreshControl.addTarget(self, action: "handleRefresh:", forControlEvents: UIControlEvents.ValueChanged)
tableView.insertSubview(refreshControl, atIndex: 0)
tableView.sendSubviewToBack(refreshControl)
And this is how I create the headers:
func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let header: UITableViewHeaderFooterView = view as! UITableViewHeaderFooterView
header.contentView.backgroundColor = UIColor(red: 59/255, green: 134/255, blue: 134/255, alpha: 1.0)
header.textLabel.textColor = UIColor.whiteColor()
header.alpha = 0.5
}
Thanks a lot!
source
share