![(logo)](http://images.cnitblog.com/blog2015/497279/201505/051004492043385.png)
## MJRefresh
* An easy way to use pull-to-refresh
* 用法简单的下拉刷新框架:一行代码搞定
## Contents
* Getting Started
* [Features【支持哪些控件的刷新】](#支持哪些控件的刷新)
* [Installation【如何使用MJRefresh】](#如何使用MJRefresh)
* [Who's using【已经超过上百个App正在使用MJRefresh】](#已经超过上百个App正在使用MJRefresh)
* [Classes【MJRefresh类结构图】](#MJRefresh类结构图)
* 常见API
* [MJRefreshComponent.h](#MJRefreshComponent.h)
* [MJRefreshHeader.h](#MJRefreshHeader.h)
* [MJRefreshFooter.h](#MJRefreshFooter.h)
* [MJRefreshAutoFooter.h](#MJRefreshAutoFooter.h)
* Examples
* [Reference【参考】](#参考)
* [下拉刷新01-默认](#下拉刷新01-默认)
* [下拉刷新02-动画图片](#下拉刷新02-动画图片)
* [下拉刷新03-隐藏时间](#下拉刷新03-隐藏时间)
* [下拉刷新04-隐藏状态和时间](#下拉刷新04-隐藏状态和时间)
* [下拉刷新05-自定义文字](#下拉刷新05-自定义文字)
* [下拉刷新06-自定义刷新控件](#下拉刷新06-自定义刷新控件)
* [上拉刷新01-默认](#上拉刷新01-默认)
* [上拉刷新02-动画图片](#上拉刷新02-动画图片)
* [上拉刷新03-隐藏刷新状态的文字](#上拉刷新03-隐藏刷新状态的文字)
* [上拉刷新04-全部加载完毕](#上拉刷新04-全部加载完毕)
* [上拉刷新05-自定义文字](#上拉刷新05-自定义文字)
* [上拉刷新06-加载后隐藏](#上拉刷新06-加载后隐藏)
* [上拉刷新07-自动回弹的上拉01](#上拉刷新07-自动回弹的上拉01)
* [上拉刷新08-自动回弹的上拉02](#上拉刷新08-自动回弹的上拉02)
* [上拉刷新09-自定义刷新控件(自动刷新)](#上拉刷新09-自定义刷新控件(自动刷新))
* [上拉刷新10-自定义刷新控件(自动回弹)](#上拉刷新10-自定义刷新控件(自动回弹))
* [UICollectionView01-上下拉刷新](#UICollectionView01-上下拉刷新)
* [UIWebView01-下拉刷新](#UIWebView01-下拉刷新)
* [期待](#期待)
## <a id="支持哪些控件的刷新"></a>支持哪些控件的刷新
* `UIScrollView`、`UITableView`、`UICollectionView`、`UIWebView`
## <a id="如何使用MJRefresh"></a>如何使用MJRefresh
* cocoapods导入:`pod 'MJRefresh'`
* 手动导入:
* 将`MJRefresh`文件夹中的所有文件拽入项目中
* 导入主头文件:`#import "MJRefresh.h"`
```objc
Base Custom
MJRefresh.bundle MJRefresh.h
MJRefreshConst.h MJRefreshConst.m
UIScrollView+MJExtension.h UIScrollView+MJExtension.m
UIScrollView+MJRefresh.h UIScrollView+MJRefresh.m
UIView+MJExtension.h UIView+MJExtension.m
```
## <a id="已经超过上百个App正在使用MJRefresh"></a>已经超过上百个App正在使用MJRefresh
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141212365041650.png" width="200" height="300">
* 更多App信息可以关注:[M了个J-博客园](http://www.cnblogs.com/mjios/p/4409853.html)
## <a id="MJRefresh类结构图"></a>MJRefresh类结构图
![](http://images0.cnblogs.com/blog2015/497279/201506/132232456139177.png)
- 图中`红色文字的类`:可以直接拿来用
- 下拉刷新控件的种类
- 默认(Normal):`MJRefreshNormalHeader`
- 动图(Gif):`MJRefreshGifHeader`
- 上拉刷新控件的种类
- 自动刷新(Auto)
- 默认(Normal):`MJRefreshAutoNormalFooter`
- 动图(Gif):`MJRefreshAutoGifFooter`
- 自动回弹(Back)
- 默认(Normal):`MJRefreshBackNormalFooter`
- 动图(Gif):`MJRefreshBackGifFooter`
- 图中`非红色文字的类`:拿来继承,用于自定义刷新控件
- 关于如何自定义刷新控件,可以参考下图的类<br>
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141358159107893.png" width="30%" height="30%">
## <a id="MJRefreshComponent.h"></a>MJRefreshComponent.h
```objc
/** 刷新控件的基类 */
@interface MJRefreshComponent : UIView
#pragma mark - 刷新状态控制
/** 进入刷新状态 */
- (void)beginRefreshing;
/** 结束刷新状态 */
- (void)endRefreshing;
/** 是否正在刷新 */
- (BOOL)isRefreshing;
#pragma mark - 其他
/** 根据拖拽比例自动切换透明度 */
@property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha;
@end
```
## <a id="MJRefreshHeader.h"></a>MJRefreshHeader.h
```objc
@interface MJRefreshHeader : MJRefreshComponent
/** 创建header */
+ (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
/** 创建header */
+ (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 这个key用来存储上一次下拉刷新成功的时间 */
@property (copy, nonatomic) NSString *lastUpdatedTimeKey;
/** 上一次下拉刷新成功的时间 */
@property (strong, nonatomic, readonly) NSDate *lastUpdatedTime;
/** 忽略多少scrollView的contentInset的top */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop;
@end
```
## <a id="MJRefreshFooter.h"></a>MJRefreshFooter.h
```objc
@interface MJRefreshFooter : MJRefreshComponent
/** 创建footer */
+ (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
/** 创建footer */
+ (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
/** 提示没有更多的数据 */
- (void)endRefreshingWithNoMoreData;
/** 重置没有更多的数据(消除没有更多数据的状态) */
- (void)resetNoMoreData;
/** 忽略多少scrollView的contentInset的bottom */
@property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom;
/** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏) */
@property (assign, nonatomic) BOOL automaticallyHidden;
@end
```
## <a id="MJRefreshAutoFooter.h"></a>MJRefreshAutoFooter.h
```objc
@interface MJRefreshAutoFooter : MJRefreshFooter
/** 是否自动刷新(默认为YES) */
@property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh;
/** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
@property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent;
@end
```
## <a id="参考"></a>参考
```objc
* 由于这个框架的功能较多,就不写具体文字描述其用法
* 大家可以直接参考示例中的MJTableViewController、MJCollectionViewController、MJWebViewController,更为直观快速
```
<img src="http://images0.cnblogs.com/blog2015/497279/201506/141345470048120.png" width="30%" height="30%">
## <a id="下拉刷新01-默认"></a>下拉刷新01-默认
```objc
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
}];
或
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 马上进入刷新状态
[self.tableView.header beginRefreshing];
```
![(下拉刷新01-普通)](http://images0.cnblogs.com/blog2015/497279/201506/141204343486151.gif)
## <a id="下拉刷新02-动画图片"></a>下拉刷新02-动画图片
```objc
// 设置回调(一旦进入刷新状态,就调用target的action,也就是调用self的loadNewData方法)
MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
// 设置普通状态的动画图片
[header setImages:idleImages forState:MJRefreshStateIdle];
// 设置即将刷新状态的动画图片(一松开就会刷新的�
没有合适的资源?快使用搜索试试~ 我知道了~
上拉刷新下拉加载 新版MJRefresh EGO
共316个文件
png:80个
json:71个
m:66个
4星 · 超过85%的资源 需积分: 10 124 下载量 154 浏览量
2016-01-19
15:49:04
上传
评论
收藏 1.14MB ZIP 举报
温馨提示
上拉刷新下拉加载 新版MJRefresh EGO上拉刷新下拉加载 新版MJRefresh EGO上拉刷新下拉加载 新版MJRefresh EGO上拉刷新下拉加载 新版MJRefresh EGO
资源推荐
资源详情
资源评论
收起资源包目录
上拉刷新下拉加载 新版MJRefresh EGO (316个子文件)
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.gitignore 229B
PullTableView.h 3KB
MJRefreshComponent.h 3KB
MJRefreshComponent.h 3KB
EGORefreshTableHeaderView.h 3KB
MJRefreshConst.h 2KB
MJRefreshConst.h 2KB
LoadMoreTableFooterView.h 2KB
MessageInterceptor.h 2KB
MJRefreshFooter.h 1KB
MJRefreshFooter.h 1KB
MJRefreshHeader.h 1KB
MJRefreshHeader.h 1KB
UIScrollView+MJRefresh.h 1KB
UIScrollView+MJRefresh.h 1KB
UIScrollView+MJExtension.h 833B
UIScrollView+MJExtension.h 833B
MJRefreshAutoFooter.h 828B
MJRefreshAutoFooter.h 828B
MJRefreshStateHeader.h 754B
MJRefreshStateHeader.h 754B
UIView+MJExtension.h 690B
UIView+MJExtension.h 690B
MJTestViewController.h 659B
MJExample.h 609B
MJRefreshAutoStateFooter.h 573B
MJRefreshAutoStateFooter.h 573B
MJRefreshBackGifFooter.h 562B
MJRefreshAutoGifFooter.h 562B
MJRefreshAutoGifFooter.h 562B
MJRefreshBackGifFooter.h 562B
MJRefreshGifHeader.h 546B
MJRefreshGifHeader.h 546B
MJRefreshBackStateFooter.h 534B
MJRefreshBackStateFooter.h 534B
MJRefresh.h 532B
MJRefresh.h 532B
AppDelegate.h 496B
MJCollectionViewController.h 466B
MJExampleViewController.h 455B
MJNavigationController.h 454B
MJTableViewController.h 451B
MJRefreshBackNormalFooter.h 434B
MJRefreshBackNormalFooter.h 434B
MJRefreshNormalHeader.h 418B
MJRefreshNormalHeader.h 418B
MJTempViewController.h 380B
MJRefreshAutoNormalFooter.h 372B
MJRefreshAutoNormalFooter.h 372B
AppDelegate.h 296B
AppDelegate.h 288B
UIViewController+Example.h 268B
MJChiBaoZiHeader.h 264B
MJChiBaoZiFooter2.h 242B
MJChiBaoZiFooter.h 240B
MJSingleViewController.h 240B
MJWebViewViewController.h 238B
ViewController.h 234B
MJRefreshBackFooter.h 233B
MJRefreshBackFooter.h 233B
MJDIYAutoFooter.h 232B
MJDIYBackFooter.h 232B
MJExampleWindow.h 227B
ViewController.h 226B
MJDIYHeader.h 210B
Contents.json 1KB
Contents.json 1KB
Contents.json 1KB
Contents.json 335B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
Contents.json 320B
共 316 条
- 1
- 2
- 3
- 4
资源评论
- xingguonline2017-07-04还行,比较完整。
M.Siebel
- 粉丝: 183
- 资源: 54
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功