Sephiroth87 / ODRefreshControl

A pull down to refresh control like the one in Apple's iOS6 Mail App
MIT License
2.15k stars 385 forks source link

Activity View doesn't appear in UITableView when it has a tableHeaderView #57

Open jvenegas opened 11 years ago

jvenegas commented 11 years ago

Hello,

The UIActivityView doesn't appear after calling "beginRefreshing". That is only happening when a UITableView has a tableHeaderView set up, like this code:

ODRefreshControl *refreshControl = [[ODRefreshControl alloc] initInScrollView:self.tableView]; [refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged]; self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 10)]; [refreshControl beginRefreshing];

Thank you for this Refresh Control guys!

Edit

I fixed with this code:

   [refreshControl beginRefreshing];
    //Hack to fix the Bug in the ODRefreshControl when UITableView has a header
    [tableView setContentOffset:CGPointMake(0.0f, -44.0f) animated:YES];