[翻译] AAPullToRefresh

本文详细介绍了AAPullToRefresh组件的安装、使用、定制和方法,适用于iOS6及以上版本,通过CocoaPods方式或手动安装。提供了实例代码演示如何在项目中集成并自定义该组件。

AAPullToRefresh

效果:

Requirement - 需要的环境

  • ARC.
  • iOS 6 or higher(tested on iOS 6, 7 and 8).

Install - 安装

CocoaPods CocoaPods方式安装

Add pod 'AAPullToRefresh' to your Podfile.

Manually 手动安装

  1. Copy AAPullToRefresh directory to your project. 将AAPullToRefresh文件夹拷贝到你的项目当中.

Usage - 使用

#import "AAPullToRefresh.h"
...
AAPullToRefresh *tv = [self.scrollView addPullToRefreshPosition:AAPullToRefreshPositionTop actionHandler:^(AAPullToRefresh *v){
    // do something...
    // then must call stopIndicatorAnimation method.
    [v performSelector:@selector(stopIndicatorAnimation) withObject:nil afterDelay:1.0f];
}];

Customization - 定制

Property - 属性

You can customize below properties.

tv.imageIcon = [UIImage imageNamed:@"launchpad"];
tv.borderColor = [UIColor whiteColor];
tv.borderWidth = 3.0f;
tv.threshold = 60.0f;
tv.showPullToRefresh = NO; // also remove KVO observer if set to NO.

Method - 方法

- (void)manuallyTriggered;    // Manually trigger the block.
- (void)setSize:(CGSize)size; // Zoom in/out size.

 

转载于:https://www.cnblogs.com/YouXianMing/p/4119897.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值