Skip to content

need to show noMoreData in the first page #73

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

Open
Jenus opened this issue May 19, 2017 · 4 comments · May be fixed by #162
Open

need to show noMoreData in the first page #73

Jenus opened this issue May 19, 2017 · 4 comments · May be fixed by #162

Comments

@Jenus
Copy link

Jenus commented May 19, 2017

Hi, there was one condition to show nomoredata. All data was fetched when first loading. "scrollView.contentOffset.y + scrollView.contentInset.top ==0" made "self.alpha = 0.0"; when scroll the tableview, enter the condition of instant return. so the footer with nomoredata was 0 alpha, did not display.

The following was one fix:

guard isRefreshing == false && isAutoRefreshing == false && noMoreData == false && isHidden == false else {
//++++++++++++++++++++
if noMoreData { //不满一页的时候,需要加载
if scrollView.contentSize.height <= 0.0 || scrollView.contentOffset.y + scrollView.contentInset.top <= 0.0 {
self.alpha = 0.0
} else {
self.alpha = 1.0
}
}
//++++++++++++++++++++----end

        // 正在loading more或者内容为空时不相应变化
        return
    }
@Jenus
Copy link
Author

Jenus commented May 22, 2017

In order to display "no More Data" footer to append the first page[ e.g. 5 items/ 10 paging].
In-depth, noMoreData setter method should notify ESRefreshFooterView::offsetChangeAction, so it is reasonable to make independent call "noticeNoMoreData".

so fixit can replaced with the following :
//++++++++++++++++++++
if noMoreData { //不满一页的时候,需要加载
if scrollView.contentSize.height > 0.0
self.alpha = 1.0
}
//++++++++++++++++++++----end

and,

open var noMoreData = false {
didSet {
if noMoreData != oldValue {
self.animator.refresh(view: self, stateDidChange: noMoreData ? .noMoreData : .pullToRefresh)
+ self.offsetChangeAction(object: nil, change: nil)
}
}
}

@Jenus
Copy link
Author

Jenus commented May 22, 2017

@eggswift,

could you confirm this as one problem? If so, I will expect it fix as soon as possible with new pod. Thanks

@Pulichev
Copy link

@Jenus you can use DZNEmptyDataSet for it

@yeziahehe
Copy link

Same request.

Can not use DZNEmptyDataSet, because first page has data, just data count less than page size, so need to call noMoreData in first page.

@yeziahehe yeziahehe linked a pull request Jun 10, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants