I write a custom inspector with UIElements. And I want to bind an array to a ListView.
But the ListView is not fill the inspector automatic by it height.
I have to set the ‘height=500px’ in the style to force the ListView has a height.
And I find the reorderable is not working in the inspector, and the ListView in UIElements is not as good as the ReordableList in IMGUI.
How can I correctly use a ListView in the Inspector?
To get the same look and feel as the IMGUI list, you need to set a few more attributes. (You can see how we configure it in PropertyField.cs → ConfigureListView)
This parity with IMGUI was only added for 2021.2, so if you can’t afford the upgrade to a beta build right now, I’m afraid you won’t have that feature set.
So how can we override the reorder-mode of a PropertyField? I have a List bound to a property field of an editor window made with UIBuilder- and I cannot drag items into it unless I first reorder them first. And even after I do, it begins to behave sort of like a queue, I put a new item in element 0 and it pushes whatever was there to the next field if there is one, and vice-versa. I tried setting the reorder-mode: Simple in the style of the UXML element and nothing happened. If instead, I use the NonReorderable attribute on my List field, it works fine, but I lose the ability to reorder, obviously, and to use the footer with the +/- buttons