- Home /
Question by
chillersanim · May 21, 2019 at 05:59 PM ·
guilistscrollviewlayout
Unity GUI fitting item list with max size
Hi all.
Goal:
I want to make an item list in the GUI that grows it's size based on the amount of items, but within bounds.
The list should fit the items displayed and be as small as possible.
At the same time, the list shouldn't be able to grow larger than a max size and use a scrollview instead.
Example:
Problem:
My problem is, that I can either create a scrollview that has a fixed size and doesn't fit, or make a list that grows and fits but is unbounded.
I've tried the VerticalLayoutGroup, the ContentSizeFitter and the ScrollView, but wasn't able to create something that satisfies my conditions.
Can somebody explain me how I can achieve my goal?
I prefer solutions that just use Unity components, but code solutions are also fine.
Thank you
size-example.png
(16.7 kB)
Comment