[翻译] CBStoreHouseRefreshControl

  • 时间:
  • 浏览:0
  • 来源:大发5分快乐8_极速5分11选5

We've a wiki page for that, feel free to add your projects there!

The CBStoreHouseRefreshControl's shape contains bunch of BarItem for animation, each BarItemis running its own animation, you need to provide startPoint and endPoint through a plist file.

Alternatively, you can just drag CBStoreHouseRefreshControl (.h .m) and BarItem (.h .m) into your own project.

Who's using it?

让人使用PaintCode来生成起始点与结束点

Easy way to generate startPoint and endPoint?

You can attach it to any UIScrollView like UITableView or UICollectionView using following simple static method:

结果看起来会是曾经子的哦:

CBStoreHouseRefreshControl is available through CocoaPods, to install it simply add the following line to your Podfile:

All BarItem will share one coordinate system whose origin is at the top-left corner. For example if you want to draw a square, the plist will look like this:

How to use your own shape

Lastly, make sure you've implemented the refreshAction you passed it earlier to listen for refresh triggers:

让人将它打上去到UIScrollView的任何子类当中,用如下的有有另另4个最好的措施 :

Then, implement UIScrollViewDelegate in your UIViewController if you haven't already, and pass the calls through to the refresh control:

Play with following parameters to configure CBStoreHouseRefreshControl's view and animation:

For more details, please check out the demo app's code.

因此用下面的有有另另4个最好的措施 进行更多的设置:

CBStoreHouseRefreshControl

The result will look like this:

Author

让人根据如下的你这人参数来配置CBStoreHouseRefreshControl的动画效果:

You can get more info here.

最后,确保你实现了刷新的操作:

Result:

所有的BarItem会分享同有有另另4个坐标系统,你这人 坐标系统的原始顶点在左上角。因此你是要绘制有有另另4个正方形,越来越 ,plist文件中就应该是如下的样子。

CBStoreHouseRefreshControl的特性饱含了一系列的BarItem用于动画,每有有另另4个BarItem都执行他自身的动画,你前要给朋友在plist文件底下提供有有另另4个起始值和结束值。

@isaced mentions that it's easier to use PaintCode to generate startPoint and endPoint:

Configuration

让人使用有有另另4个plist文件来存储图形样式,就像如下的我的公司的loga样式:

How to use it

What is it?

更多细节,请查阅示例代码。

Suyu Zhang

suyu_zhang@hotmail.comsuyuzhang.com

You can use any shape through a plist file, like this one which is my company's logo:

Which files are needed?

CBStoreHouseRefreshControl支持 CocoaPods, 打上去以下一行代码到Podfile中即可:

 

Or, using this method for more configurable options:

A fully customizable pull-to-refresh control for iOS inspired by Storehouse iOS app

这是有有另另4个完整篇 可定制的下拉刷新控件,灵感来自于应用Storehouse

因此,在你的控制器中实现你的UIScrollViewDelegate的你这人最好的措施 ,你将那先 代理最好的措施 的值传进去即可:

另一种最好的措施 要是:你把 CBStoreHouseRefreshControl (.h .m) 和 BarItem (.h .m) 文件拖到你的项目中就前要了。