[翻译] CBStoreHouseRefreshControl

  • 时间:
  • 浏览:0
  • 来源:UU快3—全天最准大发快三

Result:

CBStoreHouseRefreshControl

 

Author

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:

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

How to use it

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.

What is it?

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

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

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

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

Who's using it?

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

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

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

我就将它加上到UIScrollView的任何子类当中,用如下的可是我土方法:

但会 ,在你的控制器中实现你的UIScrollViewDelegate的你这个土方法,你将那些代理土方法的值传进去即可:

可能用下面的可是我土方法进行更多的设置:

Or, using this method for more configurable options:

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

另一种土方法可是我:你把 CBStoreHouseRefreshControl (.h .m) 和 BarItem (.h .m) 文件拖到你的项目中就可不上能 了。

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

CBStoreHouseRefreshControl的结构含高 了一系列的BarItem用于动画,每可是我BarItem都执行他自身的动画,你须要给亲戚亲戚朋友在plist文件后面 提供可是我起始值和现在结束值。

Easy way to generate startPoint and endPoint?

How to use your own shape

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

我就使用可是我plist文件来存储图形样式,就像如下的我的公司的loga样式:

我就根据如下的你这个参数来配置CBStoreHouseRefreshControl的动画效果:

Configuration

You can get more info here.

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

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

Which files are needed?

我就使用PaintCode来生成起始点与现在结束点

结果看起来会是另可是我子的哦:

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:

The result will look like this:

这是可是我完整性可定制的下拉刷新控件,灵感来自于应用Storehouse

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