I have a ToggleButtonGroup with FlexDirection set to Column. Setting the FlexDirection appears to work on how the label is arranged, but not how the buttons are arranged. The buttons are always in row direction. Does anybody know how to achieve a column layout? The group container is read-only.
You would add a USS style sheet to your UXML file and create a USS style for the container. In this case you could use a selector that just uses the same name as the container element, ergo #unity-toggle-button-group__container
.
Or if you only want it to apply to a specific toggle group, you can rename the visual element, and use a descendant selector. For example: #my-toggle-group #unity-toggle-button-group__container
.
Definitely need to learn to use style sheets and style selectors: Unity - Manual: Introduction to USS
Thanks for your help!
Using #unity-toggle-button-group__container
as a selector works. Is there a reason a selector must be used via USS, rather than set inline?
Regarding using a descendant selector… I was initially unable to save a new name for ToggleButtonGroup when I changed it in UIBuilder - the renaming worked at first, but it reverted to the default name when saving. I was able to name it by editing the UXML via IDE. Not sure if this is a bug.
The greyed out visual elements are being generated by the root element for the control. They aren’t serialized into the uxml, so inline values for them can’t be set.
Not sure about this. Haven’t run into this issue myself. Though I try to not have the uxml open while editing in the UI Builder at the same time.