美文网首页
MJGif刷新

MJGif刷新

作者: Goldfish_jinyu | 来源:发表于2016-11-14 10:30 被阅读24次
    #pragma mark --TABLEVIEW
    -(void)createBBTableView{
    
        _bbtTV = [[UITableView alloc]initWithFrame:CGRectMake(SCREEN_W, 0, SCREEN_W, _classBV.scrollView.frame.size.height) style:UITableViewStylePlain];
        _bbtTV.delegate = self;
        _bbtTV.dataSource = self;
        _bbtTV.separatorStyle = UITableViewCellSeparatorStyleNone;
        [_classBV.scrollView addSubview:_bbtTV];
        _bbtTV.tableHeaderView = _bbtHeadView;
        
        //刷新
        [self RefreshGifBB];
    }
    
    #pragma mark --RefreshGif刷新
    -(void)RefreshGif{
        NSMutableArray *idleImages = [NSMutableArray array];
        for (NSUInteger i = 1; i<=10; i++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%ld.png", i]];
            [idleImages addObject:image];
        }
        //    下拉刷新
        MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(upRefreshData)];
        header.lastUpdatedTimeLabel.hidden = YES;
        header.stateLabel.hidden = YES;
        [header setImages:idleImages forState:MJRefreshStateIdle];
        [header setImages:idleImages forState:MJRefreshStatePulling];
        [header setImages:idleImages forState:MJRefreshStateRefreshing];
        _listTV.mj_header = header;
    //    [header beginRefreshing];
        
        //    上拉刷新
        MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
        [footer setTitle:@"加载成功" forState:MJRefreshStateIdle];
        [footer setTitle:@"刷新中" forState:MJRefreshStateRefreshing];
        [footer setTitle:@"没有更多" forState:MJRefreshStateNoMoreData];
        footer.stateLabel.font = [UIFont systemFontOfSize:12];
        footer.stateLabel.textColor = [UIColor grayColor];
        _listTV.mj_footer = footer;
    }
    -(void) upRefreshData{
    NSLog(@"下拉刷新");
    }
    -(void) loadMoreData{
    NSLog(@"上拉加载");
    }
    
    

    相关文章

      网友评论

          本文标题:MJGif刷新

          本文链接:https://www.haomeiwen.com/subject/avlhpttx.html