美文网首页
UIRefreshControl

UIRefreshControl

作者: 程序员不务正业 | 来源:发表于2017-08-24 21:38 被阅读17次

    UIRefreshControl

    平时很少用UIRefreshControl,iOS开发者上手就是MJRefresh 都忘记还有UIRefreshControl这么一个系统提供的控件了。

    使用方法

    @property (nonatomic, strong) UIRefreshControl *refreshControl;
    
    self.refreshControl = [[UIRefreshControl alloc] init];
    [_refreshControl addTarget:self
                        action:@selector(refreshView:)
              forControlEvents:UIControlEventValueChanged];
    [self.refreshControl setAttributedTitle:[[NSAttributedString alloc] initWithString:@"更新中..."]];
    [self.refreshControl setTintColor:[UIColor lightGrayColor]];
    [self.tableView addSubview:self.refreshControl];
    
    
    
     - (void)refreshView:(UIRefreshControl *)control {
    
          [self loadMoreMessage];
        }
    
     - (void)endRefreshing {
           self.isLoading = NO;
           [self.refreshControl endRefreshing];
        }

    相关文章

      网友评论

          本文标题:UIRefreshControl

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