【发布时间】:2014-02-15 17:37:11
【问题描述】:
我已经看到很多关于 UIRefreshControl 的问题,我的 UITableViewController 也有问题。这个问题发生得如此随机,因此我无法弄清楚它为什么或如何发生。
问题是,有时当您在 tableView 上向下滚动时,UIRefreshControl 出现在错误的位置,并且看起来像在 tableView 本身的上方/顶部。我附上了问题的截图,以及我用于添加 UIRefreshControl 的代码,它也是刷新方法。
感谢您提供的任何帮助!
- (void)viewDidLoad
{
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self action:@selector(refreshing:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:self.refreshControl];
self.tableView.tableFooterView = [[UIView alloc] init];
}
- (void)refreshing:(UIRefreshControl*)refreshControl
{
[refreshControl beginRefreshing];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
[refreshControl endRefreshing];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
【问题讨论】:
标签: ios objective-c uitableview uirefreshcontrol