开发者

UITableView header not displaying correctly after update to underlying data

I have been experiencing strange behavior with the header drawing the first time. Here are the steps I go through and it is reproducible every time.

  • Go to Tab 2. Select an item to download.
  • Download completes and imports data into CoreData database, which is linked to the TableView on Tab 1 (shown).
  • I do make the following calls on the TableView:

}

-(void)controllerWillChangeContent:(NSFetchedResultsController*)controller {
    [self.setsTableView beginUpdates];
}

-(void)controllerDidChangeContent:(NSFetchedResultsController*)controller {
    [self.setsTableView endUpdates];
}

As soon as I move the TableView scroll up or down, the problem immediately resolves itself. Also, if I quit the app and go back in, the header is displayed correctly.

I have drawn a red box around the problem area.

Anyone ever see this behavior before?

UITableView header not displaying correctly after update to underlying data

Notice the difference in how the header is displayed below. This is how it SHOULD look from the start. All I do between screenshot 1 (above) and screenshot 2 (below) is scroll the UITableView.

UITableView header not displaying correctly after update to underlying data


With the latest build of iOS, this problem seems to have gone away. I never did find a solution to it.


Did you remember to reload the table when the new data is available using this method. this is running on main thread, UI are only run on main thread

 dispatch_async(dispatch_get_main_queue(), ^{

                    [self.tableview reloadData];

                });

it's update..............

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜