Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UITableView flicker #84

Closed
aamahdwalker opened this issue Jul 12, 2018 · 3 comments
Closed

UITableView flicker #84

aamahdwalker opened this issue Jul 12, 2018 · 3 comments

Comments

@aamahdwalker
Copy link

aamahdwalker commented Jul 12, 2018

Experiencing bug on iPhoneX only. Cannot reproduce in simulator. When I let go of pull, the tableView quickly snaps to the top of the view and then readjusts to proper position under navigation bar.

@aamahdwalker aamahdwalker changed the title UITableView glitch after touches ended UITableView flicker Jul 13, 2018
@ren6
Copy link

ren6 commented Jan 23, 2019

@aamahdwalker I have the same issue. How did you fix it?

@ren6
Copy link

ren6 commented Jan 23, 2019

Okay, I fixed it like this. In DGElasticPullToRefreshView.swift inside displayLinkTick() method I changed this:

scrollView.contentInset.top = bounceAnimationHelperView.dg_center(isAnimating()).y
scrollView.contentOffset.y = -scrollView.contentInset.top

to this:

let oldValue = scrollView.contentInset.top
let newValue = bounceAnimationHelperView.dg_center(isAnimating()).y
if oldValue > newValue && oldValue > 0 && (newValue == 0 || newValue == DGElasticPullToRefreshConstants.LoadingContentInset) && oldValue - newValue > DGElasticPullToRefreshConstants.LoadingContentInset {
  print("SKIP STRANGE INSET CHANGING: from \(oldValue) to \(newValue)")
} else {
   scrollView.contentInset.top = newValue
   scrollView.contentOffset.y = -scrollView.contentInset.top
}

@aamahdwalker
Copy link
Author

aamahdwalker commented Jan 23, 2019

@ren6 Nice! Another fix is to add lines 301-302 in animation block like so..

  [UIView animateWithDuration:0.1 animations:^{
        scrollView.contentInset = contentInset;
    }
                     completion:^(BOOL finished) {
                         completionBlock();
                     }];
} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants