xhzengAIB / XHRefreshControl

XHRefreshControl 是一款高扩展性、低耦合度的下拉刷新、上提加载更多的组件。
MIT License
736 stars 149 forks source link

如何直接使用XHRefreshControl? #18

Open heyehao2008 opened 9 years ago

heyehao2008 commented 9 years ago

看你的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; }

这样使用是否正确呢?

xhzengAIB commented 9 years ago

你好! 只需要初始化,然后实现你需要的Delegate就可以了

xhzengAIB commented 9 years ago

我准备写一个分类来处理这个问题,以后可能就比较方便了