yon*_* ho 9 iphone uitableview uiviewcontroller ios
我知道如何在视图控制器中添加pull-to-refresh.但是现在情况是:我有一个UIView&包含a UITableView,我想在tableview的最底部拉出表视图来重新加载它的数据.
如何在其中添加pull-to-refresh UITableView,而不是它的父视图的控制器.
vin*_*vin 25
在ViewDidLoad中添加以下内容:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
[self.myTableView addSubview:refreshControl];
Run Code Online (Sandbox Code Playgroud)
并刷新
- (void)refresh:(id)sender
{
// do your refresh here and reload the tablview
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14585 次 |
| 最近记录: |