Auto Sizing Scroll Views

When using a Scroll View in unity, you can set it’s size or have it dynamically scale. I’m many projects dynamic scaling seems to be the best option. To make the scroll view auto scale you need to add two components to the content object.

The Content Object contains the objects that need to be scrolled to be viewed.

A “Content Size Fitter” set to constrain the view-able area to the preferred size is needed to keep the scroll bars updated.

A Grid Layout Group will make sure the content in the “Content” object are displayed in a nice orderly fashion and at the size they are supposed to be viewed. the “Cell Size” should be set to the individual content size. if you are displaying more than one content item at a time then setting the spacing between the items makes everything look well organized.

Leave a Reply