Skip to content

如何直接使用XHRefreshControl? #18

@RondaHo

Description

@RondaHo

看你的demo,都是重写了uitableViewController,能否直接使用XHRefreshControl。
我试了一下,有很多问题,不知道我的方法对不对:
UITableView *tableView = [[UITableView alloc]initWithFrame:self.view.bounds];
tableView.delegate = self;
tableView.dataSource = self;
[self.view addSubview:tableView];

_customRefresh = [[XHRefreshControl alloc]initWithScrollView:tableView delegate:self];
_customRefresh.circleColor = Navigation_Title_Color;
_customRefresh.circleLineWidth = 1;

实现delegate:
-(void)beginPullDownRefreshing{
NSLog(@"刷新数据");
[self performSelector:@selector(endRefreshing) withObject:nil afterDelay:5];
}

-(void)beginLoadMoreRefreshing{
NSLog(@"加载更多");
}

-(XHRefreshViewLayerType)refreshViewLayerType{
return XHRefreshViewLayerTypeOnScrollViews;
}

-(XHPullDownRefreshViewType)pullDownRefreshViewType{
return XHPullDownRefreshViewTypeCircle;
}

  • (void)endRefreshing{
    [self.customRefresh endPullDownRefreshing];
    }

这样使用是否正确呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions