User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

built_in:layouts

This is an old revision of the document!


Table of Contents

Layouts

Layouts are the base to position controls over the screen of your Android device.

Types

There are the following types of layouts:

  • Linear
  • Absolute
  • Frame Layouts

Linear layouts allow you to add controls one after another without overlapping them, in a vertical or horizontal way.

Absolute layouts allows you to add controls in any position relative to the width and height of your screen from 0 to 1.

Frame layouts are used to display objects in front or behind each other

Methods

Method Description
Layout.AddChild( child,order )
Layout.Animate( type,callback ) known types:
SlideFromLeft
ScaleFromLeft
SlideToLeft
ScaleToLeft
SlideFromRight
ScaleFromRight
SlideToRight
ScaleToRight
SlideFromTop
ScaleFromTop
SlideToTop
ScaleToTop
SlideFromBottom
ScaleFromBottom
SlideToBottom
ScaleToBottom
Layout.ChildToFront( child )
Layout.Destroy()
Layout.DestroyChild( child )
Layout.GetAbsHeight()
Layout.GetAbsWidth()
Layout.GetChildOrder( child )
Layout.GetHeight()
Layout.GetPosition()
Layout.GetType()
Layout.GetVisibility()
Layout.GetWidth()
Layout.Release()
Layout.RemoveChild( child )
Layout.SetBackColor( colorCode )
Layout.SetBackGradient( color1,color2,color3,p4,p5,p6,p7 )
Layout.SetBackGradientRadial( x,y,r,color1,color2,color3,p7 )
Layout.SetBackground( imageFile, options ) options is an optional string that can be “repeat”
Layout.SetMargins( left,top,right,bottom )
Layout.SetOrientation( orient ) “Portrait” or “Landscape”
Layout.SetPadding( left, top, right, bottom )
Layout.SetPosition( left, top, width, height )
Layout.SetScale( x,y )
Layout.SetSize( width, height )
Layout.SetTouchable( touchable )
Layout.SetVisibility( visibility ) “Hide” or “Show”

Options

You can combine options too. Use the comma to seperate the options:

app.CreateLayout("Linear", "Horizontal,FillXY,TouchThrough");
Vertical
Horizontal
VCenter
TopCenterDefault
FillX
FillY
FillXY
Right
Left
Bottom
TouchThrough
built_in/layouts.1422092164.txt.gz · Last modified: 2015/01/24 17:36 (external edit)