iOS 7 UIRefreshControl tintColor not working for beginRefreshing

前端 未结 19 1650
我在风中等你
我在风中等你 2020-12-04 13:48

I\'m trying to set a tintColor on my UIRefreshControl (building on iOS 7). I enabled refreshing for the tableViewController in storyboard, then in my ViewController vi

19条回答
  •  时光取名叫无心
    2020-12-04 14:29

    Hey just stumbled into this exact issue.

    Interestingly I fixed my code by setting the contentOffset first then calling beginRefreshing

    if(self.tableView.contentOffset.y == 0){
        self.tableView.contentOffset = CGPointMake(0, -self.refreshControl.frame.size.height);
        [self.refreshControl beginRefreshing];
    }
    

    You may want to animate this process:

    [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^(void){
        self.tableView.contentOffset = CGPointMake(0, -self.refreshControl.frame.size.height);
    } completion:^(BOOL finished) {
        [self.refreshControl beginRefreshing];
    }];
    

    Hope this helps you.

    W

提交回复
热议问题