当我从tableview中移除所有对象并且当时tableview的动画重新加载tableview时会闪烁。
我正在做这样的事情:
-(void)viewDidLoad {
[super viewDidLoad];
self.voiceSTableView.voicestationDelegate = self;
refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(getRefreshData) forControlEvents:UIControlEventValueChanged];
UITableViewController *tableViewController = [[UITableViewController alloc] init];
tableViewController.tableView = self.voiceSTableView ;
tableViewController.refreshControl = refreshControl;
self.voiceSTableView.refreshController = refreshControl;
}
-(void)getRefreshData{
if(isRequestLoading){
[refreshControl endRefreshing];
return;
}
[self.voiceSTableView.arVoicerData removeAllObjects];
[UIView animateWithDuration:0 animations:^{
[self.voiceSTableView reloadData];
} completion:^(BOOL finished) {
}];
}
即使这段代码也无效:
[self.voiceSTableview reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];