Giter Club home page Giter Club logo

pull-to-refresh's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pull-to-refresh's Issues

发现一个问题,应该是手误

在 ESRefreshHeaderView这个类中有个小小的问题,或者说,我没看明白吧,

public override func startAnimating() {

......
// Navigation will automatically add 64, we are here to deal with part of the logic
if scrollView.contentInset.top != insets.top || scrollView.contentOffset.x != -insets.top {
UIView .animateWithDuration(0.2, animations: {
scrollView.contentInset = insets
scrollView.contentOffset = CGPoint.init(x: scrollView.contentOffset.x, y: -insets.top)
})
}
......
}

您能解释一下,if判断的第二个条件是什么意思?是不是scrollView.contentOffset.y != -inset.top?

请问能定制显示的内容么?

在class ESRefreshHeaderAnimator中定义了pullToRefreshDescription。用户可以改动么?

我想像网易那样,在下拉刷新时能显示离上次刷新的时间。请问现在能做到么?如果不能,能否考虑加进去?

多谢。

pod update failed


[!] Error installing ESPullToRefresh
[!] /usr/local/bin/git clone /Users/lihao/Workspace/Github/pull-to-refresh /var/folders/yz/ld8zk61n36b6dm12hly91_y40000gn/T/d20161225-36795-h8je64 --template= --single-branch --depth 1 --branch 2.3

fatal: repository '/Users/lihao/Workspace/Github/pull-to-refresh' does not exist

tableview loadmore

tableview set the dynamic line is high, the load does not stop after the first

Remove Observer crashes

removeObserver crashed in ESRefreshComponent - not always but often!

*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <App.ESRefreshHeaderView 0x108b05430> for the key path "contentOffset" from <App.UITableView 0x1030ec200> because it is not registered as an observer.'

load more 展示错误

simulator screen shot 2017 1 21 12 30 37

Demo 最后一页,预期为 『No more data』,实际 『Loading more』


查看源码

// Back state
        UIView.animate(withDuration: 0.3, delay: 0, options: .curveLinear, animations: {
        }, completion: { (finished) in
            self.animator.refresh(view: self, stateDidChange: .pullToRefresh)
            super.stop()
        })

stop 函数结束后,默认变更为了 pullToRefresh 导致的 ... 这里重置为 pullToRefresh 的原因是?

期待您的回复。

一个关于tableView上拉加载的问题

在上拉加载过程中,我不知道为什么,每次第一次结束之后insert Data之后,他都会回滚到TableView顶部。不知道是我的问题还是框架的问题,而当使用reload Data之后,是不会回滚到顶部的。
代码如下:

VC中的代码:
convenience init(url:String){
        self.init(nibName: nil, bundle: nil)
        self.listModel = ZNListModel.init(baseURL: "http://news.zafu.edu.cn", url:url)

        self.tableView.es_addPullToRefresh {
            [weak self] in
            self?.listModel?.reloadData({
                self?.tableView.es_stopPullToRefresh(completion: true)
            })
        }

        self.tableView.es_addInfiniteScrolling { 
            [weak self] in

            self?.listModel?.addNewInfo({
                self?.tableView.es_stopLoadingMore()
            })

        }
    }

//数据解析完后的insert
//MARK:Delegate
    func finishLoadListView() {
//        if self.tableView.numberOfRowsInSection(0) < listModel?.listArray.count {
//            let startCount = self.tableView.numberOfRowsInSection(0)
//            let endCount = listModel?.listArray.count
//            
//            var indexPathArr:Array<NSIndexPath> = []
//            
//            for row in startCount ..< endCount! {
//                indexPathArr.append(NSIndexPath.init(forRow: row, inSection: 0))
//            }
//            
//            self.tableView.insertRowsAtIndexPaths(indexPathArr, withRowAnimation: UITableViewRowAnimation.Top)
////            self.tableView.reloadRowsAtIndexPaths(indexPathArr, withRowAnimation: UITableViewRowAnimation.Bottom)
//        }else{
            self.tableView.reloadData()
//        }
    }

//model中的代码
func addNewInfo(callback:(()->())?) {
        currentPage += 1;

        let q = dispatch_queue_create("async_queue", DISPATCH_QUEUE_SERIAL)
        let url:String = self.url!+"?page=\(currentPage)"

        dispatch_sync(q) { 
            self.getMessage(url, callback: callback)
        }
    }

func getMessage(url:String,callback:(()->())?) {
        let JiCode = Ji.init(htmlURL: NSURL(string: url)!)

        let content = JiCode?.xPath("//div[starts-with(@class,'content-right')]/ul/li/a")
        let dates = JiCode?.xPath("//div[starts-with(@class,'content-right')]/ul/li/span")

        if content != nil {
            for item in content! {
               //...解析内容(因为过多已经省去)

                //            将对应的顺序放入Array中
                self.listArray.append((title,urlStr,date,num))
            }

            let mainQueue = dispatch_get_main_queue()

            dispatch_async(mainQueue, {
                if callback != nil{
                    callback!()
                }
                self.delegate?.finishLoadListView()
            })
        }
    }


extension UIScrollView 的 func 非 public

如题,这样的 extension 意义何在?

只能手动加入? 不能通过 frameworks 方式使用?

platform :ios, '8.0'
use_frameworks!
pod 'ESPullToRefresh'

UICollectionView 无法使用问题

当UICollectionView的
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 0
}
时,下拉刷新无效?并且不在显示ESRefreshHeaderView

icon not in pod

when i use cocoapod the icon_pull_to_refresh_arrow@2x image not found

When refreshing and scrolling section headers don't stick with the top

When pulling to refresh and releasing the table view goes into the fetch new data mode (refreshing). While the data in the background is beeing loaded the user scrolls the table view. The table view has multiple sections with corresponding section headers. While scrolling the section headers normally stick on the table view's top, but not when currently refreshing. In the refreshing state between the section header and the table view's top border is a gap, but shouldn't.

This is because the lib uses insets when refreshing. These results in the gap because the section headers respect the inset, but should stick with the border.

See for a possible solution:
http://stackoverflow.com/questions/5466097/section-headers-in-uitableview-when-inset-of-tableview-is-changed

我用pod导入之后不能正常使用

self.tableView.es_addPullToRefresh {
[weak self] in
self?.tableView.es_stopPullToRefresh(completion: true)
self?.tableView.es_stopPullToRefresh(completion: true, ignoreFooter: false)
}

提示错误是:value of type “UITableView” has no member ' es_addPullToRefresh'

下拉图片获取为nil

UIImage(named: "icon_pull_to_refresh_arrow", in: Bundle(identifier: "com.eggswift.ESPullToRefresh"), compatibleWith: nil)
获取图片为空

es_startPullToRefresh

代码如下,当我在一个tableViewController中为tableView添加了下拉刷新和上拉加载,当使用es_startPullToRefresh方法时,发现,下拉刷新和上拉加载都调用了一遍,正常应该是只有下拉刷新被调用,不确定我是不是个例,我的页面中还使用了UISearchController,谢谢
self.tableView.es_addPullToRefresh { [weak self] in
guard self != nil else {return}
self?.getData()
}
self.tableView.es_addInfiniteScrolling { [weak self] in
guard self != nil else {return}
self?.loadMoreData()
}
self.tableView.es_startPullToRefresh()

变量命名问题

额, 不知道是不是我理解错, expriedTimeInterval 是不是手抖了...? 看README.md里的注释是对的, expired

infinite scroll 的问题

我的app是开始时显示当天的内容,当tableview滑到底部时会从server端抓前一天的内容。

但是我发现有时不是抓前一天的内容,而是抓前几天的内容。也就是时间都乱了。

但不是都这样。很不稳定。有时显示的正常的。有时就不对。

我看到另一个issue似乎提到了这个问题。不知道和我提的是否一样。

您能看看么?

多谢。

Please update podspec

Hi, Example project has "refreshIdentifier" related code. When I install this using pods, I'm getting 1.0.3 version which does not have the latest code. Can you please look into it?

This was called for many times, anything wrong with using it?

`[self.contentView es_addInfiniteScrollingWithHandler:^{

    if (numeroCapituloAux != (int)book.caps) {
        [self carregaCapituloWithNumeroCapitulo:++numeroCapituloAux];
    }

    [self.contentView es_stopLoadingMore];

    self.contentView.contentOffset = CGPointZero;
    [self.contentView scrollRangeToVisible:NSMakeRange(0, 1)];

}];`

swift 2.3

what kind of version should I use for swift 2.3?

嘿 man 有个bug

dome中 把 DefaultTableViewController 中
数据量改为2行 即 缩小到 并没有占满一屏
上拉刷新 改为

self.tableView.es_addInfiniteScrolling {
            [weak self] in



            let minseconds = 0.1 * Double(NSEC_PER_SEC)   //此处改为0.1  加快反馈




            let dtime = dispatch_time(DISPATCH_TIME_NOW, Int64(minseconds))
            dispatch_after(dtime, dispatch_get_main_queue() , {
                self?.page += 1
                if self?.page <= 3 {
                    for _ in 1...1{
                        self?.array.append(" ")
                    }
                    self?.tableView.reloadData()
                    self?.tableView.es_stopLoadingMore()
                } else {
                    self?.tableView.es_noticeNoMoreData()
                }
            })
        }

会使得在 ESRefreshFooterView.stopAnimating方法 中的scrollView.decelerating为true
造成 执行了

var contentOffset = scrollView.contentOffset
contentOffset.y = min(contentOffset.y, scrollView.contentSize.height - scrollView.frame.size.height)
scrollView.setContentOffset(contentOffset, animated: false)

使cell弹到了 下半屏
建议

 public override func stopAnimating() {
        guard let scrollView = scrollView else {
            return
        }
        self.animator.refreshAnimationDidEnd(self)
        self.animator.refresh(self, stateDidChange: .PullToRefresh)
        UIView .animateWithDuration(0.3, delay: 0, options: .CurveLinear, animations: { 
            self.animator.refresh(self, progressDidChange: 0.0)
            }) { (finished) in
                super.stopAnimating()
        }
    }

Providing a pull to refresh description for the header title doesn't update the header's label

Currently when providing a custom pull to refresh description for a header the text will only be used after the user has pulled the scroll view once. Before that, in its initial state and the user drags the view the library's default text will be shown. To prevent this I have to use a workaround:

let header = tableView.es_addPullToRefresh { [weak self] in
  self?.refreshData()
}
if let animator = header.animator as? ESRefreshHeaderAnimator {
  animator.loadingDescription = "My custom text"
  animator.pullToRefreshDescription = "My custom text"
  animator.releaseToRefreshDescription = "My custom text"
  animator.refreshAnimationEnd(view: header) // Workaround to update the header's label (ESPullToRefresh 2.4)
}

When setting the animator.pullToRefreshDescription property it should instantly update the header's label with the given string when in the pullToRefresh state.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.