ODRefreshControl icon indicating copy to clipboard operation
ODRefreshControl copied to clipboard

A quick scroll will lead to refresh unpurposely

Open ipeisong opened this issue 12 years ago • 11 comments

In iOS 6 mail, only when your finger keep staying on screen to pull will trigger the refresh, which is the correct behavior.

This control is great, but my users complain very often they just scroll from bottom to top with a high acceleration, the refresh will also be trigger. Can fix this? Cos this also add more burden to server actually. Thanks.

ipeisong avatar Sep 23 '12 03:09 ipeisong

I'll work on it, thanks :)

Sephiroth87 avatar Oct 05 '12 21:10 Sephiroth87

Looking forward to this fix as well.

sjapps avatar Oct 08 '12 20:10 sjapps

It should be fixed, but as usual, a round of double checking will be appreciated :)

Sephiroth87 avatar Oct 08 '12 22:10 Sephiroth87

Works good! Thank you!

Unrelated to this but since I have your attention, I added [self.scrollView scrollRectToVisible:CGRectMake(0, 0, 1, kOpenedViewHeight) animated:YES ]; to line 418. Basically when I manually call beginRefreshing, it doesn't it down automatically without scrollrecttovisible. I'm sure there is another way

sjapps avatar Oct 09 '12 00:10 sjapps

It's not supposed to show the control when using beginRefreshing (see UIRefreshControl for reference). If you want, you can simply put that line after the call to beginRefreshing

Sephiroth87 avatar Oct 09 '12 00:10 Sephiroth87

Maybe I misunderstood the purpose of beginRefreshing but whats the point of calling it if you can't see the loading indicator?

sjapps avatar Oct 09 '12 00:10 sjapps

Well, I'm not entirely sure, but I made it so it's consistent with Apple's implementation... I think it's just for when you have more than one way to trigger the refresh, like a button, so you can't trigger it twice...

Sephiroth87 avatar Oct 09 '12 22:10 Sephiroth87

Thanks for such a great component. I tried to achieve the same behaviour of SJApps (i.e. on beginRefresh, I'd like to animate-to-display the activity view). I tried with scrollRectToVisible:CGRectMake and in several other ways. Just wanted to let you know that they only way it works for me is by adding 1 pixel to the scroll height:

[self.scrollView scrollRectToVisible:CGRectMake(0, 0, 1, kOpenedViewHeight+1) animated:YES];

All other attempts (and there were many!) failed. Incidentally, I was thinking that beginRefresh:animate:BOOL and endRefresh:animate:(BOOL) could be added to the API.

Thanks!

thorar avatar Oct 26 '12 16:10 thorar

Thank you :)

I have to say, I actually have no idea how that could work, since you are not scrolling where the control is, but below it...

I'm pretty sure this works just fine, unless you are doing something strange somewhere else :P

[refreshControl beginRefreshing]; [self.scrollView setContentOffset:CGPointMake(0, -44) animated:YES];

Sephiroth87 avatar Oct 26 '12 17:10 Sephiroth87

Now, if you tap the status-bar to scroll to top and then start pulling the table, the refresh control doesn't appear.

nestserau avatar Nov 02 '12 13:11 nestserau

For myself I fixed it simply by adding:

...CGFloat offset = [[change objectForKey:@"new"] CGPointValue].y + self.originalContentInset.top;
if (_lastOffset == 0) {
    _canRefresh = YES;
}

if (_refreshing) {...

nestserau avatar Nov 02 '12 13:11 nestserau