Dan*_*man 1 iphone uiviewcontroller ios uirefreshcontrol
我创建了一个没有TableViewController的UIRefreshcontrol.我的问题是我如何在另一种方法中结束它?这就是我创造它的方式;
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh) forControlEvents:UIControlEventValueChanged];
[_tableView addSubview:refreshControl];
Run Code Online (Sandbox Code Playgroud)
我在@Justin Paulsson的帮助下发现这可以做到;
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[_tableView addSubview:refreshControl];
Run Code Online (Sandbox Code Playgroud)
-
-(void) handleRefresh:(UIRefreshControl *)controller
{
//Refresh code
controller.endRefreshing;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2369 次 |
| 最近记录: |