How to set the size of widget inside a scrollbox?

Hi all!

I have some widgets with buttons in root. I want to set those widgets in scrollbox menu, but they appear very small.

Size of widgets:

X = size of scrollbox

Y = ???


So… How to set Y size of widgets?
I tried to “set des. size in viewport”, before i add them to the scrollbox, bu it didnt work. Tried to Set Size of Grid, UniGrid and vertBox slots, but that didn’t help me as well.

Someone? :frowning:

Hi AIFlakky,

Can you show us an image of the Designer for your Widget, including the Hierarchy panel so we can see how you have this set up? You can also zip and attach the .uasset file if that’s easier. Thanks!

Here it is… Left is the scrollbox with widgets, right is widget with button, that i want to add in ScrollBox.

Hello AlFlakky,

If you would like to be able to set the size of things in your scroll box, one of the ways that I have found to do this is to add a canvas panel to your scroll box. You can use multiple canvas panels if needed. It will appear very small at first but as soon as you place anything inside the canvas panel it will assume the size of what ever widget you place in it. You can then size it to your specifications . I have attached an image to show my hierarchy. I hope this helps.

Make it a great day

Thank for answer, but i still have very small size. How did you change the size of CanvasPanel? I use 4.5.1

Hello AlFlakky,

After further testing it appears that the workflow that I gave is only viable in 4.6. I was unable to come up with a workaround for the 4.5.1 version of the engine. As you can see this is a known issue and it has been addressed in a later version.

Well ok then. Will continue to work on this part, after 4.6 will be released.
But it would be great, if we can set the size of slots right in ScrollBox/VerticalBox settings. Or in slots settings, because now it looks like it sets the size of widgets or CanvasPanels to 0.

Anyway, thank you for answering me! :slight_smile:

Very helpful, thank you!

It not work for me.
I`m 4.8.3.

Hello ALangHung,

I just tried this solution in 4.8.3 and appears to work as expected. The hierarchy is as follows:

[v] Canvas panel

    [v] ScrollBox

        [v] CanvasPanel 


After you have this setup you can then change the size of your widget. I hope that this helps.

Make it a great day

I found Size-Scale-Image works for me in 4.20 and setting say 200 as max Desired Height in Size widget.