[翻译] CBStoreHouseRefreshControl

  • 时间:
  • 浏览:3
  • 来源:大发5分排列5_极速5分排列3

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

你会使用另1个 plist文件来存储图形样式,就像如下的我的公司的loga样式:

Result:

有一种,在你的控制器中实现你的UIScrollViewDelegate的有一种办法,你将哪几种代理办法的值传进去即可:

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

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

Suyu Zhang

suyu_zhang@hotmail.comsuyuzhang.com

What is it?

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

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

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

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

Easy way to generate startPoint and endPoint?

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

Or, using this method for more configurable options:

CBStoreHouseRefreshControl的形状蕴藏了一系列的BarItem用于动画,每另1个 BarItem都执行他自身的动画,你都要给有一种人在plist文件里边提供另1个 起始值和结速值。

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

你会根据如下的有一种参数来配置CBStoreHouseRefreshControl的动画效果:

The result will look like this:

你会使用PaintCode来生成起始点与结速点

另有一种办法也不:你把 CBStoreHouseRefreshControl (.h .m) 和 BarItem (.h .m) 文件拖到你的项目中就都要了。

You can get more info here.

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

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

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:

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

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

Who's using it?

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

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

Which files are needed?

你会将它打上去到UIScrollView的任何子类当中,用如下的另1个 办法:

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

How to use it

 

Author

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.

CBStoreHouseRefreshControl

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

有一种用下面的另1个 办法进行更多的设置:

Configuration

How to use your own shape