问题描述
- 结束 `UIRefreshControl`
-
创建了没有TableViewController
的UIRefreshcontrol
,如何在另一个方法中结束它?这是创建方法:UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(handleRefresh) forControlEvents:UIControlEventValueChanged]; [_tableView addSubview:refreshControl];
解决方案
我找到解决方法了已经
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[_tableView addSubview:refreshControl];
-
-(void) handleRefresh:(UIRefreshControl *)controller
{
//Refresh code
controller.endRefreshing;
}
时间: 2024-12-05 10:39:10