RATreeView
RATreeView copied to clipboard
Disable Auto scrolling to top
Hi,
i'm facing a problem, when i expand a cell the treeview automatically scrolls to top. I can't disable it using scrollsToTop or alwaysBounceVertical properties of tableview.
How can i disable this?
Thanks!
I've been looking for the bug and it seems to be with custom tableViewCells
Have you managed to fix this issue?
No @Augustyniak, I ended developing my own Tree :(
i met this problem tooooooo
I've had the same issue and here is a quick fix. CGPoint offset = treeView.contentOffset; // Do collapse/expand stuffs here treeView.contentOffset = offset; So just set contentOffset to the original one after updates.
I'm also seeing the issue after inserting multiple rows via insertItemsAtIndexes. It occurs when collapsing the last row in the table as well.
This is more evident when actually implementing heightForRowForItem in he view controller. My guess is that when expanding, the new height of the table view is not calculated properly, as it somehow does not know the height of the cells added.
This is a show-stopper, I really hope someone will figure this out.
EDIT:
I want to also point out that removing
[self.tableView beginUpdates]; [self.batchChanges beginUpdates];
and
[self.batchChanges endUpdates]; [self.tableView endUpdates];
- (void)collapseCellForTreeNode:(RATreeNode *)treeNode withRowAnimation:(RATreeViewRowAnimation)rowAnimation
and
- (void)expandCellForTreeNode:(RATreeNode *)treeNode withRowAnimation:(RATreeViewRowAnimation)rowAnimation
Seemed to improve the problem a lot, but it does not eliminate it. My guess is that there are a lot of unnecessary animation setups in this point...
I comment line 101 in RATreeView+TableViewDelegate.m. It seems worked. But I am not sure this would cause other issue?