|
|
@@ -9,6 +9,11 @@
|
|
|
* [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-默认)
|
|
|
@@ -70,6 +75,77 @@ UIView+MJExtension.h UIView+MJExtension.m
|
|
|
- 关于如何自定义刷新控件,可以参考下图的类<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)noticeNoMoreData;
|
|
|
+/** 重置没有更多的数据(消除没有更多数据的状态) */
|
|
|
+- (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 appearencePercentTriggerAutoRefresh;
|
|
|
+
|
|
|
+/** 防止加载数据速度过快时,连续刷新N次 */
|
|
|
+@property (assign, nonatomic, getter=isPreventContinuousRefreshing) BOOL preventContinuousRefreshing;
|
|
|
+@end
|
|
|
+```
|
|
|
+
|
|
|
## <a id="参考"></a>参考
|
|
|
```objc
|
|
|
* 由于这个框架的功能较多,就不写具体文字描述其用法
|