iOS 7 UIRefreshControl tintColor not working for beginRefreshing

前端 未结 19 1711
我在风中等你
我在风中等你 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:21

    @william-george's answer set me in the right direction, but was giving me weird autolayout animation issues.

    So here's the version that worked for me:

    - (void)programaticallyRefresh {
        // Hack necessary to keep UIRefreshControl's tintColor
        [self.scrollView setContentOffset:CGPointMake(0, -1.0f) animated:NO];
        [self.scrollView setContentOffset:CGPointMake(0, -self.refreshControl.frame.size.height) animated:YES];
        [self.refreshControl beginRefreshing];
        [self refresh];
    }
    

    -refresh is the method tied to the UIRefreshControl.

提交回复
热议问题