cranimation / crrefresh Goto Github PK
View Code? Open in Web Editor NEWAn easy way to use pull-to-refresh
License: MIT License
An easy way to use pull-to-refresh
License: MIT License
There is an issue with RamotionBallLayer()
When you use the RamotionAnimation, a user can scroll down through a list (assuming the refresh is in header). When they scroll back up quickly, however, I noticed a bug where the while cirlce will appear, blocking content on the screen, even though it is not animating.
A quick-fix for this would be set the 'isHidden' attribute in the initialization method as shown below:
class RamotionBallLayer: CALayer {
init(frame: CGRect, duration: CFTimeInterval, moveUpDist: CGFloat, color: UIColor = .white) {
upDuration = duration
super.init()
self.frame = frame
let circleWidth = min(frame.size.width, frame.size.height)
circleLayer = CircleLayer(size: circleWidth, moveUpDist: moveUpDist, frame: frame, color: color)
addSublayer(circleLayer)
// Hide the ball layer on init
isHidden = true
}
}
Declarations from extensions cannot be overridden yet
https://github.com/CRAnimation/CRRefresh/blob/master/README_CN.md
上拉刷新应该是 footer
下拉刷新应该是 header
Please update the version for Swift 5.0
In Swift 4.0 build error
pod 安装的版本貌似不是最新的
When UICollectionView is empty or there are a few contents not as many as enough to scroll, CR is unable to refresh.
好像oc不能直接用
refresh indicator not in center in RTL Mode
why?
你好
我正在使用你的框架搭建也页面的刷新加载功能。出现了以下问题
当我反复调用添加footer,会出现整个scrollView的inset.bottom持续增加。即使我在重新添加之前移除了上一个footer,scrollView的inset.bottom也不会重置。
声明:我没有在调戏框架,而是某个需求页面导致当前页面根据不同的筛选条件,产生分页或者不分页的情况,所以会出现反复调用添加和删除【好像没有找到使header、footer失效的选项_(:з」∠)_ 】
Currently the component supports real pull of scrollview, is there any possibility where the scrolling could be started programmatically?
不过至今也没在 GitHub 发现别的支持 largeTitle 的刷新和上推隐藏导航栏和这两种组件
下来箭头不显示,可否用下面代码解决
fileprivate let imageView: UIImageView = {
let imageView = UIImageView.init()
if /* Carthage */ let bundle = Bundle.init(identifier: "com.eggswift.CRRefresh") {
imageView.image = UIImage(named: "refresh_arrow", in: bundle, compatibleWith: nil)
} else if /* CocoaPods */ let bundle = Bundle.init(identifier: "org.cocoapods.CRRefresh") {
imageView.image = UIImage(named: "NormalHeader.bundle/images/refresh_arrow", in: bundle, compatibleWith: nil)
} else /* Manual */ {
imageView.image = UIImage(named: "refresh_arrow")
}
// imageView.image = crBundle?.imageFromBundle("refresh_arrow")
return imageView
}()
ex:
if !collectionView.cr.isRefreshing {
// do something
}
It seems that position of header is not updated in FastAnimator.layoutSubviews() when device is rotated
--> Is there any way to modify the title texts from "Pull down to refresh", "Release to refresh" to something else ?
When we force refresh using the HeadRefresh (with NormalHeaderAnimator), when the scrollView populates with cells (in my case is a collectionView) the first cell is partially hidden behind the navigation bar, but after touching/scrolling the scrollView the collectionView automatically snaps itself on the correct position and the bug is gone.
After headRefresh finishes to load the data:
After touching/scrolling the collectionView:
Has anyone experienced this before? How can I fix it?
在kvo里面添加如下打印 能打印出来 如果cell的大小为一个屏幕高度 会造成 回退不正常
if keyPath == CRRefreshComponent.contentSizeKeyPath {
if isIgnoreObserving == false {
sizeChange(change: change)
}
} else if keyPath == CRRefreshComponent.offsetKeyPath {
if isIgnoreObserving == false {
offsetChange(change: change)
if isIgnoreObserving {
print("qqqqqq")
}
}
}
Animator.riggerIfTracking = true
which trigger only when user is scrolling and not for fastscrolling
在该行报错 start.delegate = self
hi i need to use it in my app but my code is in objective ci am unable to call method in my class
what is tableview.cr?
Has anybody tested this for iOS 11? If you set header before viewDidAppear, than first row(s) are hided under navigation bar. If you try to begin end animation multiple times or even in right order one by one, than the same...
这动画翻译 OC 好麻烦~
Flick scroll to top when release to refresh
您好,首先很感谢作者写了这个纯swift的刷新控件库,通过学习源码,自己也学习了很多,再次感谢!
我在使用过程中遇到了上面的问题,猜测应该是在下拉刷新重新计算scrollview的contentInset.top时,多计算了一次animator.hold,导致刷新结束后,tableview会有向上偏移的情况,刚好偏移一个animator.hold。
项目进度原因,我并没有深入调用机制去查询根本原因,这里我用了比较trick的方法解决了此问题。
CRRefresh 版本 1.0.9
文件: CRRefreshHeaderView.swift
lineNum: 104
如果作者有时间,麻烦看下此问题,期待下个版本解决,感谢!
在RamotionWaveLayer的startDownAnimation断点后,动画不能执行完整。
上拉加载的时候,上拉不放手,tableView会弹回,然后重复加载状态,然后导致多次加载。
是什么原因footer没有像header一样,添加拖拽手势的判断呢?没有pulling状态的判断
I'm experiencing a issue where footer keeps triggering once i trigger it manually.
here the code
table.cr.addFootRefresh(animator: NormalHeaderAnimator()) { [weak self] in
guard let self = self else { return }
if self.selectedFilter.rawValue > SearchFilterType.All.rawValue {
self.handleSearch(for: trim(self.txtSearch.text))
}
self.table.cr.endLoadingMore()
}
and in handleSearch, i'm query the database and then reloading the tableview
xcode 版本8.2.1,pod 导入,报错use of unresolved identifier 'NormalHeaderAnimator'
在func refresh(view: CRRefreshComponent, progressDidChange progress: CGFloat)这个函数中添加让UIView旋转的动画代码:
imageView.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi)*progress)
imageView的变形有异常,希望开发者看看。
It doesn't appear that there is much activity support iOS13/Swift 5, so thought I'd drop a very hacky solution for supporting pull-to-refresh, particularly in a modal.
Since CRRefresh
uses tableView.addSubview
instead of tableView.refreshControl
, the experience gets a bit odd in iOS13, in particular with modal sheets. Pulling down to refresh will actually dismiss the modal, instead of refreshing the tableView. There are some solutions that use isModalInPresentation = true
, but that allows for a slight drag of the modal, and no affordance showing that PTR is happening. See this SO thread:
My solution was to fake the RefreshControl
, but hide it.
extension UITableView {
func iOS13RefreshControlHack() {
if #available(iOS 13.0, *) {
let refreshControl = UIRefreshControl()
refreshControl.tintColor = .clear
self.refreshControl = refreshControl
self.refreshControl?.addTarget(self, action: #selector(handleRefreshControl), for: .valueChanged)
}
}
@objc func handleRefreshControl() {
self.refreshControl?.endRefreshing()
}
}
Then call from your tableView via (or whatever better name you choose):
self.tableView.iOS13RefreshControlHack()
This triggers the modal to behave properly when PTR is requested, but also continues to show the CRRefresh
custom spinners/checkmark instead. In addition, you can still dismiss the modal by pulling down from the navigationBar
, but the modal does not move when pulling on the table cells.
Hope it helps someone.
如题
Thanks for good lib ! I use it already.
But with infinite-scrolling feature, how i can trigger it when not yet scroll to bottom? I want to load more when scroll about 80% of content size.
Hi, I'm just wondering if this library can have the options to change the title color or pull to refresh description, or the color of the activity indicator etc.
Thanks
latest version not currently updated to cocoapods.
iPhone X, iOS 12.1 环境下
在UIViewController显示时,CRRefresh自动开启了刷新动画,调用endHeaderRefresh 后顶部下移。
调试后才发现,CRRefresh是监听contentOffset 来做刷新的。
而UIViewController为了实现“Under Top Bars”, tableView.contentOffset 会被设置为 CGPoint(x: 0, y: -88) 。这就造成了冲突。
所以, CRRefresh能否只是监听由手指拖拽引起的contentOffset变化来做刷新的?
或者有什么其它办法可以解决上述问题?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.