有没有办法将刷新控件应用于 UIViewController
中设置的 UITableView
?
我找到的解决方案需要 UITableViewController
的子类化,这对我来说很麻烦,因为我需要子类化 UIViewController
而不是 UITableViewController
,并且我在 UITableView
的文档下没有看到任何允许我在其上设置刷新控件的方法。
任何帮助将不胜感激!
最佳答案
使用这个 UIRefreshControl
控件:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh1:) forControlEvents:UIControlEventValueChanged];
[Delivered_TBL addSubview:refreshControl];
- (void)refresh1:(UIRefreshControl *)refreshControl
{
[self Service_Call];
[refreshControl endRefreshing];
}
关于ios - 如何将刷新控件应用于 UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31202717/