ScrollView auto size

ScrollView auto size
0.0 0

#1

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:


#2

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


#3

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


#4

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.


#5

:thinking::thinking: I will try this.


#6

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


#7

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