Category:UI Controls

Sets the width and height for the UI element.

Your app sometimes needs to resize UI elements on a screen. All UI elements (button(), textInput(), textLabel(), dropDown(), checkBox(), radioButton(), image()), can be resized. It is usually easier to place UI elements in their initial positions, with initial sizes, using Design mode in App Lab. In Design mode you can also specify font size, font color and background color for UI elements.


// Three sizes.
image("idSmall", "");
setSize("idSmall", 50, 50);
image("idMedium", "");
image("idLarge", "");
setSize("idLarge", 200, 200);


setSize(id, width, height)


Name Type Required? Description
id string The ID of the UI element to which this event handler applies. Must begin with a letter, contain no spaces, and may contain letters, digits, - and _.
height number The height to set the UI element to, in pixels.
width number The width to set the UI element to, in pixels.


  • If a UI element is sized larger than the screen only the part that fits in the screen is displayed. The screen default size is 320 pixels wide and 450 pixels high.

Found a bug in the documentation? Let us know at