MJRefresh快速配置模板代码

  • 下拉刷新配置
    MJRefreshNormalHeader *header=[MJRefreshNormalHeader headerWithRefreshingBlock:^{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    // 结束刷新
    [tableView.mj_header endRefreshing];
    });
    }];
    // 设置文字
    [header setTitle:@"下拉可以刷新" forState:MJRefreshStateIdle];
    [header setTitle:@"松开后刷新" forState:MJRefreshStatePulling];
    [header setTitle:@"正在加载中..." forState:MJRefreshStateRefreshing];
    // 设置字体
    header.stateLabel.font = [UIFont systemFontOfSize:14];
    header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:12];
    // 设置颜色
    header.stateLabel.textColor = [UIColor grayColor];
    header.lastUpdatedTimeLabel.textColor = [UIColor grayColor];
    // 设置箭头
    [header arrowView].image=[UIImage imageNamed:@"blueArrow.png"];

    tableView.mj_header=header;
    // 设置自动切换透明度(在导航栏下面自动隐藏)
    tableView.mj_header.automaticallyChangeAlpha = YES;

你可能感兴趣的:(MJRefresh快速配置模板代码)