3

I'm trying to add a UIRefreshControl to a webviews scrollview. The refreshControl is added and works but when pulled down the scrolling of the UIScrollView slows down tracking as described in this answer https://stackoverflow.com/a/19926917/896173. This causes a "jump" on the refreshController just before the refresh action is triggered.

The webview is in a UIViewController, I don't know how to implement the suggested solution 'cause I don't seem to have access to the setContentInset method.

Any ideas on how to accomplish this?

Code:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Add UIRefreshControl
    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
    refreshControl.backgroundColor = [UIColor grayColor];
    [refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
    [self.webView.scrollView addSubview:refreshControl];
}

Thanks!

Community
  • 1
  • 1
Alexander
  • 133
  • 2
  • 10

0 Answers0