UIRefreshControl* refreshControl = [[UIRefreshControl alloc] initWithFrame:CGRectMake(0, 0, 5, 5)];
refreshControl.tintColor = [UIColor whiteColor];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:refreshControl];
self.refreshControl= refreshControl;
系统的下拉刷新,样式太丑!想要如下效果,使用activityIndicatorView配合MJRefresh实现
__weak typeof(self) weakSelf = self;
self.tableView.headRefreshBlock = ^{
[weakSelf loadMemberData];
};
self.activityIndicatorView=[[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(0,0,20,20)];
self.activityIndicatorView.centerX =self.view.centerX;
[self.activityIndicatorView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
[self.headView addSubview:self.activityIndicatorView];
WechatIMG2.jpeg
网友评论