How would you do if you had a vertival layout composed of buttons and you wanted:
- the witdth of the buttons to be the same witdth as the vertical layout
- the height of each button to be driven by the text inside it
The solution has to work by code as I create each elements by script.
I have tried to follow the doc but it does not work:
I tried to use “contentSizeFitter”
I tried to use “LayoutElement”
I tried to use a vertical or horizontal layout on each buttons and desactivate childforcesWidth
I tried a lots of more stuff.
I run unity 2020.3.24f1 LTS on windows
Even manually I cannot seem to find a system that works.
Thanks in advance.