zoukankan      html  css  js  c++  java
  • <第三方>TGRefreshO按照QQ的刷新方式下拉刷新

    一 、使用方法:
     
    刷新机制,类似QQ一样的刷新机制,弹簧、橡皮筋下拉刷新控件,类似QQ下拉刷新效果,同时支持其他样式:
     
    首先写上这一句(必须的)
     
    #import <TGRefresh.h>
    如果需要,在你的控制器中加上一句
     
    self.automaticallyAdjustsScrollViewInsets=NO;
    QQ效果
     
    self.tableview.tg_header = [TGRefreshOC  refreshWithTarget:self action:@selector(doRefreshSenior) config:nil];
    普通效果
     
    self.tableview.tg_header = [TGRefreshOC  refreshWithTarget:self action:@selector(doRefreshSenior) config:^(TGRefreshOC *refresh) {
            refresh.tg_kind(RefreshKindNormal);
        }];
    更多配置,使用链式编程配置
     
        self.tableview.tg_header = [TGRefreshOC  refreshWithTarget:self action:@selector(doRefreshSenior) config:^(TGRefreshOC *refresh) {
            refresh.tg_refreshResultBgColor([[UIColor orangeColor] colorWithAlphaComponent:0.8])
            .tg_bgColor([UIColor colorWithWhite:0.8 alpha:1])
            .tg_refreshResultTextColor([UIColor whiteColor]);
        }];
    开始刷新
     
    [self.tableview.tg_header beginRefreshing];
    (网络请求等情况得到数据后)结束刷新
     
    [self.tableview.tg_header endRefreshing];
    结束刷新时的回显
     
            self.tableview.tg_header.refreshResultStr = @"成功刷新数据来自回显信息”;
            [self.tableview.tg_header endRefreshing];
    可以配置的属性
     
    /** 类型,默认为QQ弹簧 皮筋效果 */
    @property(nonatomic,assign) TGRefreshKind kind;
    /** 背景色(在有contentInset时为scrollview等背景色) */
    @property(nonatomic,strong) UIColor * bgColor;
    /** 主题色(刷新文字颜色、ActivityIndicator颜色、橡皮筯颜色) */
    @property(nonatomic,strong) UIColor * tinColor;
    /** 垂直对齐,默认顶部 */
    @property(nonatomic,assign) TGRefreshAlignment verticalAlignment;
    /** 刷新成功时的提示文字 */
    @property(nonatomic,copy) NSString * refreshSuccessStr;
    /** 准备刷新时的提示文字 */
    @property(nonatomic,copy) NSString * refreshNormalStr;
    /** 即将刷新时的提示文字 */
    @property(nonatomic,copy) NSString * refreshPullingStr;
    /** 正在刷新时的提示文字 */
    @property(nonatomic,copy) NSString * refreshingStr;
    /** 更新结果的回显文字 */
    @property(nonatomic,copy) NSString * refreshResultStr;
    /** 更新结果的回显背景色 */
    @property(nonatomic,strong) UIColor * refreshResultBgColor;
    /** 更新结果的回显文字颜色 */
    @property(nonatomic,strong) UIColor * refreshResultTextColor;
    /** 更新结果的回显高度 */
    @property(nonatomic,assign) CGFloat refreshResultHeight;
    /** 自动改变透明度,默认已做优化 */
    @property(nonatomic,assign) BOOL automaticallyChangeAlpha;
    /** 回显时的渐显时间 0.1 ~ 2秒 默认0.5 */
    @property(nonatomic,assign) CGFloat fadeinTime;
    /** 回显时的渐隐时间 0.1 ~ 5秒 默认1.5 */
    @property(nonatomic,assign) CGFloat fadeoutTime;
    /** 忽略初始的InsetTop */
    @property(nonatomic,assign) BOOL ignoreScrollViewContentInsetTop;
     
     
    二 、思考与行动:

    1.这个第三方库有个严重Bug,是之前Mjrefresh同样犯过的Bug,你能找出来么?
     
    2.如果要改正这个bug,要改哪些源代码?
     
     
  • 相关阅读:
    大数乘法的几种算法分析及比较(2014腾讯南京笔试题)
    【经典数据结构】Trie
    [LeetCode] MaximumDepth of Binary Tree
    [LeetCode] Minimum Depth of Binary Tree
    二叉树相关题目总结
    python之函数基础总结
    python基础之文件处理总结
    利用for循环和range输出9 * 9乘法口诀表
    购物车程序作业
    字典练习
  • 原文地址:https://www.cnblogs.com/firstrate/p/7197971.html
Copyright © 2011-2022 走看看