object:setSize()

Type Function
Library widget.*
Return value Number
Revision Release 2026.3728
Keywords widget, scroll view, ScrollViewWidget, setSize, width, height
See also object:setScrollWidth()
object:setScrollHeight()
widget.newScrollView()
ScrollViewWidget

Overview

Updates the width and height of a ScrollViewWidget. Note that if the scrollWidth or scrollHeight were set or changed, they will be overridden and require to be set once more after this function is called.

Gotchas

This method will alter the scroll bar’s horizontal position. To fix this issue, call object:setScrollWidth() immediately afterwards. If you choose not to reset the scroll width, hiding the scroll bar is recommended.

Syntax

object:setSize( newWidth, newHeight )
newWidth (required)

Number. The new width.

newHeight (required)

Number. The new height.

Example

scrollView:setSize( 900, 2000 )