When I`m adding new elements on vertical layout group and when there is no more place to them vertical layout group starting to expand downstairs. How to make them adding from the top of each other?
What do I want:
First element is always downstairs, next elements are spawning at top of it.
Thanks.
Ok, I found one solution. Idk if it is correct, but it is the simpliest one. Just need to rotate "Rect tranform" for 180 degrees. Solution in image
The video of the result: google drive.
yourGameObject.transform.SetAsFirstSibling(); is the solution.
Can be done at the end of other transform actions.
button.transform.parent = ServerMessagesContent.transform;
button.transform.position = ServerMessagesContent.transform.position;
button.transform.SetAsFirstSibling();
In the Vertical layout group(component) you can change the Child Alignment to Lower Center.
Rotating the whole UI element is not a good idea(might cause major headache down the line) and since this thread is the first thing that came up while googling, I felt I should drop this here for future devs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With