ボタンTwo buttons.How do I display EXECUTE_A and EXECUTE_B?
②Please tell me how to pass the new Date arguments at once.
Thank you for your cooperation.
(Reference) roDroidScript
function OnStart()
{
lay=app.CreateLayout("linear", "VCenter, FillXY");
btn=app.CreateButton("EXECUTE_A", 0.4);
btn.SetMargins(0,0.05,0,0);
btn.SetOnTouch(btn_OnTouch_A);
lay.AddChild(btn);
app.AddLayout(lay);
lay=app.CreateLayout("linear", "VCenter, FillXY");
btn=app.CreateButton("EXECUTE_B", 0.4);
btn.SetMargins(0,0.05,0,0);
btn.SetOnTouch(btn_OnTouch_B);
lay.AddChild(btn);
app.AddLayout(lay);
}
function btn_OnTouch_A()
{
myDateTime = new Date()
myDateTime=myDateTime.toLocaleString("ja")
app.ShowPopup(myDateTime+"myA");
}
function btn_OnTouch_B()
{
myDateTime = new Date()
myDateTime=myDateTime.toLocaleString("ja")
app.ShowPopup(myDateTime+"myB");
}
As for the partial answer, I think the reason for the first one is that both buttons are replaced by the common lay, btn.
You should assign distinguishable names, such as btnA
and btnB
.
© 2024 OneMinuteCode. All rights reserved.