Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

fix false origin y of emptyDataSet view when scrollview had been scrolled#182

Open
benrudhart wants to merge 1 commit into
dzenbot:masterfrom
benrudhart:master
Open

fix false origin y of emptyDataSet view when scrollview had been scrolled#182
benrudhart wants to merge 1 commit into
dzenbot:masterfrom
benrudhart:master

Conversation

@benrudhart

Copy link
Copy Markdown

after scrolling a tableView and re-showing the emptyDataSet the offset (within a tableView) won't be fixed but adjusted to the scrollView's Y contentOffset.
This PR fixes this.

@marcelmika

Copy link
Copy Markdown

Hi!

I'm having the same issue and this PR fixes it. So +1 for merge.

P.S.
However, if I use tableView.reloadSections (with animation) instead of the tableView.reloadData the placeholder animates from the top to center. It's not a big deal, since it only happens when the user scrolled down before, however, do you have any idea how to fix this too?

colinhumber added a commit to colinhumber/DZNEmptyDataSet that referenced this pull request Apr 27, 2016
@osorioabel

Copy link
Copy Markdown

Hi!
I'm having the same issue and this PR fixes it. Please do the merge

@dzenbot

dzenbot commented May 27, 2016

Copy link
Copy Markdown
Owner

@marcelmika: maybe we can add the view and adjust the frame inside of a performWithoutAnimation: method.

@allaire

allaire commented May 31, 2016

Copy link
Copy Markdown

@dzenbot Anything preventing this PR getting merge?

Just tested it and it fixed the issue for me.

Thanks for your time 🍺

@benrudhart

Copy link
Copy Markdown
Author

@dzenbot is there anything preventing this PR from being merged?

@dzenbot

dzenbot commented Jun 5, 2016

Copy link
Copy Markdown
Owner

@benrudhart: I was mostly concerned about #182 (comment)
But maybe we can tackle that in a different PR?

@allaire

allaire commented Jun 29, 2016

Copy link
Copy Markdown

@dzenbot Yes, since it's minor, we could tackle this in a different PR, absolutely.

Cheers!

@TunaYangSkey

Copy link
Copy Markdown

vote for merge +1.

For people who has the same issue, there is a way to walk around it by calling self.tableView.setContentOffset(CGPointZero, animated:false) before reload the tableView. This will scroll to the top of the tableView, hence prevent the EmptyDataSet being off the screen

@rinat-enikeev

Copy link
Copy Markdown

Other possible solution:
in Delegate:

  • (void)emptyDataSetWillAppear:(UIScrollView *)scrollView {
    [self.tableView setContentOffset:CGPointMake(0, -self.tableView.contentInset.top)];
    }

@wy284086

Copy link
Copy Markdown

I'm having the same issue, please tell me how to do

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants