Open Eisaltar opened 8 years ago
any update on this thread? I am facing the same issue
I think the problem is in your TreeMenuAdapter. ViewHolder instance should not be re-used for each node, you need to create new object every time, or
setDefaultViewHolder(Class<? extends TreeNode.BaseNodeViewHolder> viewHolder) {
to set default view holder for each node, and library will create objects for you
I'm facing the same issue. Have anyone fix it?
doesn't work for me @bmelnychuk
Hello, what i want to do is a treeView in wich each item has an imageView and a TextView. The problem is that when i want to put the treeView inside the container (FrameLayout) by using this command:
menuContainer.addView(treeView.getView());
I have this error: "The specified child already has a parent. You must call removeView() on the child's parent first." So i try like this :menuContainer.addView(treeMenuAdapter.getView());
treeMenuAdapter is my custom viewHolder, But only the last element is display.here is all the code : CreatingNode and Tree : `public void GeometrieGraphicTool(){ FrameLayout menuContainer = (FrameLayout) this.findViewById(R.id.toolContainer);
and here is my custom holder: `public class TreeMenuAdapter extends TreeNode.BaseNodeViewHolder{
private Context context;
}`
thank you for reading me and have a nice day.
ps: sorry if my English is bad I'm a Belgian student