I’ve a ScrollView where I add runtime elements. While elements are fully contained in scrollview, it has fixed size, when elements starts to be hide, scroll view height starts to increase foreach element I add. Why? It’s not for verticalbar cause actually I set it always visible.
Here what it’s happening.
I know it sounds silly, but, could you please try setting top and bottom margins to 0? We had similar auto sizing issues in the past for ScrollView (but we have many custom elements and default styles -also for ScrollView-, so sometimes some other styles affects each other unexpectedly); if I remember correctly, changing padding/margin values did fix it for us. ScrollView is actually constructed with many child elements, so things can be easily break.
And also, definitely check style values in the UI Toolkit Debugger to see what is causing the oversize problem.