Hi All, Have been able to see a Split View in the custom controls by creating a custom class like so: Code (CSharp): public class SplitView : TwoPaneSplitView { public new class UxmlFactory : UxmlFactory<SplitView, TwoPaneSplitView.UxmlTraits> { } } But when added to the Hierarchy in the UIBuilder the preview looks good but I'm not able to see the split view in the actual Editor Window. Unity 2022.1.3f1
Hi, the TwoPaneSplitView requires exactly 2 children to be functional so that might be the issue. If not I suggest using the UIToolkit debugger to inspect the split view and try to find out why it's not visible.
As mentioned above the view is there and can be seen in the UIBuilder Preview, the problem is that it's collapsed and not visible in the Editor window to which it belongs, even when the split view contains other elements such as buttons, etc...
I had the same problem as you guys: the TwoPaneSplitView was perfect in the preview but the MenuItem rendered nothing (Unity project v2021.3). I used the Windows > UI Toolkit > debugger and I noticed that my TwoPaneSplitView had height=0 for some mysterious reasons. So my "fix" is to set a minimum height. For example: <ui:TwoPaneSplitView style="min-width: 400px; min-height: 400px;">...</ui:TwoPaneSplitView> Hope it helps you.
I had the same issue and I didn't wanted to use fixed height solution, so here is the solution that I've found: In the CreateGUI() function, when initializing the treeAsset we can use CloneTree(root) instead of Instantiate() and Add(). Like this example: Instead of using: Code (CSharp): VisualElement labelFromUXML = m_VisualTreeAsset.Instantiate(); rootVisualElement.Add(labelFromUXML); I'm using only: Code (CSharp): m_VisualTreeAsset.CloneTree(rootVisualElement); Fixed my issue like magic, hope that this can help anyone too!