This site permanently moved to
https://droidscript.github.io
. Please update links accordingly.
You are being forwarded automatically in 3...
[stay here]
Back
ShowMenu
Hello World
Content:
-
Methods
Show a menu on a given control.
smu = MUI.ShowMenu(
control
,
list
,
width
) →
Object
Example - Basic usage
click to expand contents
cfg
.
Light
cfg
.
MUI
function
OnStart
(
)
{
lay
=
MUI
.
CreateLayout
(
"Linear"
,
"VCenter,FillXY"
)
btn
=
MUI
.
CreateFabOutline
(
"more_vert"
)
btn
.
SetOnTouch
(
btn_OnTouch
)
lay
.
AddChild
(
btn
)
app
.
AddLayout
(
lay
)
}
function
btn_OnTouch
(
)
{
menu
=
MUI
.
ShowMenu
(
this
,
"Item 1, Item 2, Item 3"
)
menu
.
SetOnSelect
(
function
(
item
)
{
app
.
ShowPopup
(
item
)
}
)
}
Copy All
Run
Methods
The following methods are available on the
ShowMenu
object:
SetOnSelect
(
callback
)
app object
Number:
fraction (0..1)
String:
separated
function
(
title
)
smu.SetOnSelect
Calls a function when the user selects an item.
loading