[HorizontalGroup] and [ReorderableList] conflict
jinsediaoying opened this issue · 11 comments
Thanks, I will fix it.
I just pushed a fix to the development branch, but using HorizontalGroups may be a little bit tricky. You have to use fieldToWidthRatio and labelToWidthRatio to keep elements nice looking, if values are equal to 0 (default situation) field may look strange but the horizontal group should work properly.
[BeginHorizontal(fieldToWidthRatio: 0.2f, labelToWidthRatio: 0.2f)]
public int[] ints1;
[EndHorizontal]
public int[] ints2;
Unfortunately, groups don't know how many elements are inside, that's why you have to adjust ratios.
Additionally, remember about decorators - you are able to add [SpaceArea] between elements in the horizontal group to create spacings.
The fieldToWidthRatio/labelToWidthRatio thing is confusing, it that means I have to calculate the width based on the item count per row manually?
Are you sure you have [Begin/EndHorizontalGroup] available in the settings file (Edit/Project Settings.../Editor Toolbox/Inspector)?
About fieldToWidthRatio/labelToWidthRatio - it means you can (it's not necessary) adjust the width of labels and fields within horizontal groups.
In this example labelToWidthRatio = 0.1f, it means that every label will try to fill space equal to width * 0.1f.
Sorry, I forget to change the ProjectSetting, It now looks correct.
Do you have any other troubles using horizontal groups?