Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Phone API Reference - UI Classes (Widgets) - Scroll

Derived from a group widget. Automatically adds a scrollbar when its widgets overflow the box.

Class Constructor

new Scroll()

Construct a new Scroll object.

var scrollObj = new Scroll(x, y, width, height);

Initialization Parameters

Name

Required

Type

Default

Description

y

Yes

integer

y coordinate value for top left corner.

x

Yes

integer

x coordinate value for top left corner.

width

Yes

integer

Width in pixels.

height

Yes

integer

Height in pixels.

This Class inherits methods and properties from the Widget Base Class. See  Widget Base Class  for more information about setting your Object's x, y, w, and h properties or adding children to it.

Methods

Name 

Description 

add

Adds one or more widgets to the group.

clear

Removes all child elements from the group or removes all content from the list.

remove

Removes one or more widgets from a group.

Properties

Name 

Description 

yPosition

Returns the current yPosition of the Scroll object. Note: this is not relative to the placement of the Scroll on the screen in anyway. Also can be used to set the y value of the scroll bar, causing it to scroll.

Basic Example:

//scroll down the Scroll Widget by 3 a factor of 3 LINE_HEIGHTS.
scrollObj.yPosition =(scrollObj.yPosition + (Text.LINE_HEIGHT * 3));

  • No labels