系统下拉刷新

2018-08-11  本文已影响0人  lifeLL
 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];

21533956901_.pic.jpg

WechatIMG2.jpegWechatIMG2.jpeg
上一篇下一篇

猜你喜欢

热点阅读