ScrollView auto size

Hello i am new to Cocos Creator and still learning it. Is there any way for ScrollView content holder to resize if I am setting content to programmatically? I know there is some “Widget” component but I am not sure how it works and if that will even help :frowning:

You have to use the layout component on the content inside the scrollview.

This does’t work, according to the samples collection the height of content must be calculated.

I have no problems with that. On the content node I have this

And when I add new nodes from prefabs it automatically resizes the scroll view.

You have to make sure that your items have the correct height / width.

2 Likes

:thinking::thinking: I will try this.

Yes ,you are right it’s working.
Thanks.

1 Like

Thanks for help. Works perfectly. Just what I was looking for! Sorry for late replay tho :slight_smile:

1 Like