我有一个 UITableView ,并显示从连接 WiFi 的设备接收到的数据。
我想执行相当糟糕的标准手势响应,即向下拖动表格,然后释放它,以触发更新。
我想我可以将滑动手势识别器附加到表格的底层 View ,但我想知道是否有办法直接从表格本身拦截此手势。
META:
I've been looking through the various docs and whatnot. I haven't had to do this before, so I never gave it any thought. Now I see that I probably should have thought about it.
If this is an obvious solution, I don't mind being told so, as long as you help me to find the "obvious" remedy. I'll delete this question if it's a bad one.
However, I haven't found a solution, and I'm usually fairly good at that kind of thing.
UPDATE I changed the title to better reflect what I'm asking.
最佳答案
完全原生的方法是在您的 UIViewController 中使用 UITableViewController,例如
{
tableViewController = [[UITableViewController alloc] init];
[tableViewController setTableView:myTableView];
refreshControl = [[UIRefreshControl alloc] init];
[tableViewController setRefreshControl:refreshControl];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
}
关于ios - 从 UITableView 获取 "Pull to Refresh"的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28768534/