The ListView is not expand in Inspector

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?

I attach the example code in the attached file.

7518656–927551–BindingListView.zip (21.3 KB)

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)

reorder-mode=“Animated”
show-border=“true”
show-foldout-header=“true”
header-title=“ints”
show-add-remove-footer=“true”
fixed-item-height=“20”

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.

Thanks, and I find out it work on 2021.2. My test project is working on 2020.3.

How can I setup the ‘DynamicHeight’ from the uxml? I can not find any document, or the UIToolkit source code.
BTW the document(https://docs.unity3d.com/2021.2/Documentation/Manual/UIE-ElementRef.html) is ‘item-height’ but it actually ‘fixed-item-height’.

The property is virtualizationMethod in C# and the corresponding uxml attribute would be virtualization-method="DynamicHeight"

Thanks for the heads up on the documentation, I’ll forward that to the team!

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