object:setSize()

Type Function
Library widget.*
Return value Number
Revision Release 2021.3646
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

Calling this function will mess with the x position of the scrollbar. To fix this, call object:setScrollHeight() after calling this method. If you would not like to reset the scroll height, then it might be a good idea to hide the scrollbar completely.

Syntax

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

Number. The new width.

newHeight (required)

Number. The new height.

Example

scrollView:setSize( 900, 2000 )