eggswift / pull-to-refresh

#Busy Re-Building....# An easy way to use pull to refresh and infinite scrolling in Swift. Pod 'ESPullToRefresh'
MIT License
1.83k stars 251 forks source link

storyboad中tableView 含有header的情况 没有数据的情况下 会有上拉加载更多 #128

Open coder-dongjiayi opened 6 years ago

coder-dongjiayi commented 6 years ago

数据源为空(dataSource.count = 0) 的情况 1.在storyboad中创建tableView 并添加headerView

2.添加以下代码

tableView.es.addPullToRefresh { //下拉刷新 } tableView.es.addInfiniteScrolling { //上拉加载更多 } 3.上拉动作会触发 上拉加载更多

但是在tableView没有添加header的情况下 上拉不会触发上拉加载更多 demo https://pan.baidu.com/s/1eSPPV5C

tableView有 header 但是当数据源为空的时候 不希望 触发上拉加载更多的操作

ladmini commented 4 years ago

Same question, is there any solution?

ladmini commented 4 years ago

I think the following code can solve this problem


if dataSource.count == 0 {
    self.tableView.es.removeRefreshFooter()
}
josercc commented 4 years ago

@ladmini 建议当self.tableView.footer.isHidden = true 不允许上拉了