我想在滚动出UITableView时显示activityindicator并从服务器加载更多内容。
我在几个News Feed应用程序中看到了它:
有谁知道这个,请帮助我,谢谢!
答案 0 :(得分:0)
使用UIRefreshControl
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"News Feed";
self.allNewsEntries = [NSMutableArray array];
[self downloadNewsEntries];
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refreshContent)
forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
}
-(void) refreshContent {
[self.allNewsEntries removeAllObjects];
[self downloadNewsEntries];
[self.refreshControl endRefreshing];
}