1
votes

I have a problem with header view while reloading UITableView. Actually problem is with unexpected blinking the entire view just after reload. I want dynamically change the height of the view and this animation is definitely unwanted. Is it possible to rid of this.

To reload section I use:

[self.table reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
2
are you using [self.table reloadata]?Oleg Gordiichuk
reloadSection, when I use reloadData I lose GestureRecognizer delegate from header section.mbutan
Try to remove header when you reload view and after set it backOleg Gordiichuk
what do you mean by remove header, maybe I haven't clarified it properly, the blinking occurs under Header section view when I reload section (to resize header view).mbutan
just for half second disappear header view and appear with new resized height.mbutan

2 Answers

1
votes
- (void)swipeAction:(UIPanGestureRecognizer *)gesture
{
CGFloat posY = [gesture translationInView:self.view].y;
self.dynamicHeight = posY;

NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:0];
[self reloadSection:indexSet];
}



- (void)reloadSection:(NSIndexSet *)indexSet
{

[self.tblContainer beginUpdates];
[self.tblContainer reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
[self.tblContainer endUpdates];
}


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{

UIViewController *vc = self.controllers[section];
if ([self.childViewControllers containsObject:vc]) {
} else {
    [self addChildViewController:vc];
    [vc didMoveToParentViewController:self];
}
return vc.view;
}



- (CGFloat)heightCell
{
return MIN_HEIGHT + dynamicHeight;
}



- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return [self.controllers[section] heightCell];
}
0
votes

Hmm probably you should use this approach try to indicate when you start and end update of table view :

    [self.tableView beginUpdates];
    [self.table reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
    [self.tableView endUpdates];