https://github.com/fcxpods/fcxrefresh
Pull to refresh control.
https://github.com/fcxpods/fcxrefresh
carthage cocoapods objective-c pull-refresh pull-to-refresh pullrefresh refresh refreshcontrol refreshview
Last synced: 12 months ago
JSON representation
Pull to refresh control.
- Host: GitHub
- URL: https://github.com/fcxpods/fcxrefresh
- Owner: FCXPods
- License: mit
- Created: 2017-06-30T00:00:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T08:08:10.000Z (about 4 years ago)
- Last Synced: 2025-02-22T16:06:53.627Z (about 1 year ago)
- Topics: carthage, cocoapods, objective-c, pull-refresh, pull-to-refresh, pullrefresh, refresh, refreshcontrol, refreshview
- Language: Objective-C
- Homepage:
- Size: 1.57 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FCXRefresh
[](http://cocoadocs.org/docsets/FCXRefresh/)
[](https://github.com/Carthage/Carthage)
[](https://github.com/FCXPods/FCXRefresh)
[FCXRefresh](https://github.com/FCXPods/FCXRefresh)是一个使用OC编写、用于上下拉刷新的控件。
## 特性
- [x] 普通上下拉刷新
- [x] 自动下拉刷新
- [x] 上拉无更多数据控制
- [x] 上下拉百分比显示
- [x] 自定义上下拉动画
- [x] 上拉底部间距控制
## 环境
- Xcode 11+
- iOS 8.0+
## 如何导入
### CocoaPods
```ruby
pod 'FCXRefresh'
```
### Carthage
```ogdl
github "FCXPods/FCXRefresh"
```
### 手动导入
把FCXRefresh文件夹导入即可
## 如何使用
### 包含头文件
```objc
#import "UIScrollView+FCXRefresh.h"
```
### 添加上下拉刷新
```objc
//下拉刷新
_refreshHeaderView = [self.tableView addHeaderWithRefreshHandler:^(FCXRefreshBaseView *refreshView) {
[weakSelf refreshAction];
}];
//上拉加载更多
_refreshFooterView = [self.tableView addFooterWithRefreshHandler:^(FCXRefreshBaseView *refreshView) {
[weakSelf loadMoreAction];
}];
```
### 刷新自定义设置
```objc
//自动下拉刷新
[_refreshHeaderView autoRefresh];
//自动上拉加载更多
_refreshFooterView.autoLoadMore = YES;
//上拉底部间距设置
_refreshFooterView.loadMoreBottomExtraSpace = 30;
```
### 上下拉百分比显示
```objc
_refreshHeaderView.pullingPercentHandler = ^(CGFloat pullingPercent) {
headerPercentLabel.text = [NSString stringWithFormat:@"%.2f%%", pullingPercent * 100];
};
_refreshFooterView.pullingPercentHandler = ^(CGFloat pullingPercent) {
footerPercentLabel.text = [NSString stringWithFormat:@"%.2f%%", pullingPercent * 100];
};
```
## 显示效果:

## License
FCXRefresh is released under the MIT license. See [LICENSE](https://github.com/FCXPods/FCXRefresh/blob/master/LICENSE) for details.