美文网首页
系统下拉刷新

系统下拉刷新

作者: lifeLL | 来源:发表于2018-08-11 11:11 被阅读0次
     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

    相关文章

      网友评论

          本文标题:系统下拉刷新

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