I have a UITableView with a UIRefreshControl defined inside the viewDidLoad: method for a UIViewController , as shown below:
- (void)viewDidLoad { [super viewDidLoad]; self.refreshControl = [[UIRefreshControl alloc] init]; [self.refreshControl addTarget:self action:@selector(refreshMessages) forControlEvents:UIControlEventValueChanged]; UITableViewController *tableViewController = [[UITableViewController alloc] init]; tableViewController.tableView = self.messagesTableView; tableViewController.refreshControl = self.refreshControl; } - (void)refreshMessages { //load data items if ([self.refreshControl isRefreshing]) { [self.refreshControl endRefreshing]; } [self.messagesTableView reloadData]; }
I use a cell to determine the size of the cell to update the cell data. When reloading data, the UITableView flickers. Is there any way to avoid this?
Edit I linked the video file to demonstrate an example. UITableView flickers when reloading data. I am using autolayout to update dynamic cell heights.
Here is a sample that can recreate this problem. UITableView needs to be pulled for updating. The table view is reloaded in the main queue. The camera is changed using auto power off.
ios objective-c uitableview uiviewcontroller uirefreshcontrol
Siddharthan asokan
source share