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

时间:2023-11-12 16:34:44

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

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

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