IOS6.0自带下拉刷新控件UIRefreshControl

1.UIRefreshControl必需要在IOS6.0以后才干使用,同一时候他仅仅能在UITableViewController类中才干够使用

2.使用比較简单

    self.refreshControl = [[UIRefreshControl alloc]initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 100)];
    [self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
    [self.tableView.tableHeaderView addSubview:self.refreshControl];


3.下拉之后refreshControl会一直显示,直到调用[self.refreshControl endRefreshing];


依照惯例还是附上demo

http://pan.baidu.com/s/1kTEbUmF


原文地址:https://www.cnblogs.com/slgkaifa/p/6936774.html