Back

RemoveLayout

JS Py
Hello World

Removes a layout added to the app.

app.RemoveLayout( layout )

See also: AddLayout

Example - Vertical

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

    txt = app.CreateText( "Hello" );
    txt.SetTextSize( 50 );
    lay.AddChild( txt );

    btn = app.CreateButton( "Remove" );
    btn.SetOnTouch( RemoveDrawer );
    lay.AddChild( btn );

    app.AddLayout( lay );
}

function RemoveDrawer() {
    app.RemoveLayout( lay );
}
from native import app

def OnStart():
    global lay
    lay = app.CreateLayout( "Linear", "FillXY,VCenter" )

    txt = app.CreateText( "Hello" )
    txt.SetTextSize( 50 )
    lay.AddChild( txt )

    btn = app.CreateButton( "Remove" )
    btn.SetOnTouch( RemoveDrawer )
    lay.AddChild( btn )

    app.AddLayout( lay )

def RemoveDrawer():
    app.RemoveLayout( lay )
    Copy     Copy All       Run      
app object: Layout