RATreeView icon indicating copy to clipboard operation
RATreeView copied to clipboard

Disable Auto scrolling to top

Open d-ruiz-proun opened this issue 10 years ago • 8 comments

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!

d-ruiz-proun avatar May 12 '14 08:05 d-ruiz-proun

I've been looking for the bug and it seems to be with custom tableViewCells

d-ruiz-proun avatar May 12 '14 11:05 d-ruiz-proun

Have you managed to fix this issue?

Augustyniak avatar May 28 '14 20:05 Augustyniak

No @Augustyniak, I ended developing my own Tree :(

d-ruiz-proun avatar May 29 '14 07:05 d-ruiz-proun

i met this problem tooooooo

yhl10000 avatar Jun 20 '14 06:06 yhl10000

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.

smilesworld116 avatar Jul 16 '14 17:07 smilesworld116

I'm also seeing the issue after inserting multiple rows via insertItemsAtIndexes. It occurs when collapsing the last row in the table as well.

bb44wsu avatar Oct 14 '14 17:10 bb44wsu

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...

csotiriou avatar Dec 12 '14 10:12 csotiriou

I comment line 101 in RATreeView+TableViewDelegate.m. It seems worked. But I am not sure this would cause other issue?

onlyfew avatar Nov 17 '15 08:11 onlyfew