Question by
assassinshadow · Nov 16, 2020 at 06:27 AM ·
c#guieditorwindow
Treeview inside Window editor is not scrolling.
As you can see in the image attatched. The treeview does not scroll even though it is a huge list of items. Things I have tried so far
float startY = controlRect.y + controlRect.height + 12;
Rect r = new Rect(0, startY, position.width, position.height - startY);
m_TreeViewState.scrollPos = EditorGUILayout.BeginScrollView(m_TreeViewState.scrollPos, true ,true,
GUILayout.Width(r.width) , GUILayout.Height(r.height));
m_SimpleTreeView.OnGUI(r);
EditorGUILayout.EndScrollView();
EditorGUILayout.EndVertical();
I have also tried toggling useScrollView. all to no effect. Can someone tell me what I am doing wrong? thank you very much.
treeview.png
(63.7 kB)
Comment
Best Answer
Answer by assassinshadow · Nov 17, 2020 at 05:14 AM
solved the issue by not reinitializing a treeview on the onGUI.
Hi @assassinshadow, I encountered same issue as you had before. What exactly did you do to solve the problem?