Back

Scroller

Create a Scroller using the CreateScroller method of the app object:

 scroll = app.CreateScroller( width, height, options );

The options for the Scroller are the same as the LinearLayout fill options, which set how a Scroller sizes within it's parent:- "FillX", "FillY" and "FillXY". By default Scrollers will auto-size to wrap their contents.

Create a full screen Scroller with width and height set to 1.0

Example

function OnStart()
{
    lay = app.CreateLayout( "Linear", "FillXY" );

    scroll = app.CreateScroller( 1.0, 1.0 );
    lay.AddChild( scroll );

    layScroll = app.CreateLayout( "Linear", "Left" );
    scroll.AddChild( layScroll );

    img = app.CreateImage( "/Sys/Img/Hello.png", 2.0, 2.0 );
    layScroll.AddChild( img );

    app.AddLayout( lay );
}
    Copy     Copy All      Run     

See 'CreateScroller for more informations and a complete function list