问题是用户界面出现,然后得到更新:给闪烁的影响。[self.tableview reloadData];导致闪烁
我希望UI只在用户进入应用程序时更新一次,因此我已经把重新加载到ViewDidLoad ..这里是代码..任何帮助如何消除这种闪烁......一些代码示例会有所帮助。
- (void)viewDidLoad {
[super viewDidLoad];
self.myTableView.dataSource = self;
self.myTableView.delegate = self;
PFQuery * getCollectionInfo = [PFQuery queryWithClassName:@"Collection"]; // make query
[getCollectionInfo orderByDescending:@"updatedAt"];
[getCollectionInfo setCachePolicy:kPFCachePolicyCacheThenNetwork];
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
[getCollectionInfo findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
CollectionQueryResult = (NSMutableArray *)objects;
[self.tableView reloadData];
// whenevr get result
}
else{
//no errors
}
}];
});
您的问题是什么,请详细说明您的问题。 – iPatel
问题是用户界面出现,然后得到更新:给闪烁的影响。 – user3576169
我需要单元格更新没有完整的TableView闪烁..我提到这个http://stackoverflow.com/questions/11631104/uitableview-reloaddata-how-to-stop-flicker但没有帮助 – user3576169