UIWrapContent will change the widget's size to envelop the specified root object and all of its children. UIWrapContent should be on that object's sibling. It shouldn't be used with scroll views, however. It's meant to resize widgets. The only way to use it to adjust the scroll view's dimensions is to make the scroll view a child of the UIWrapContent's widget, anchored to it. Just make sure you aren't trying to envelop the object's own children. Only siblings' children can be used, otherwise the script will count its own dimensions, resulting in an undefined behaviour.