在Tableview上拉动刷新,它有多个部分,但每个部分只包含一行

时间:2017-01-12 06:31:19

标签: objective-c uitableview pull-to-refresh

我有一个tableview,它有多个部分和标题,但每个部分都有一行,其中有一个集合视图。我想在这个tableview上实现pull to refresh方法。添加刷新控件正在处理应用程序中的其他表视图。

我试过下面的代码

refreshCustomers= [[UIRefreshControl alloc] init]; 
[refreshCustomers addTarget:self action:@selector(customersRefresh) forControlEvents:UIControlEventValueChanged];
 [self.customer addSubview:refreshCustomers];

1 个答案:

答案 0 :(得分:0)

试试这个:

UITableViewController *tableViewController = [[UITableViewController alloc] init];
tableViewController.tableView = self.customer;

self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self action:@selector(customersRefresh) forControlEvents:UIControlEventValueChanged];
tableViewController.refreshControl = self.refreshControl;
相关问题