function uiset()
function onClick()
ui.saveProfile("/sdcard/test.txt") --保存配置
isUi =false
end
function 路径获取3()
ui.newLayout("第三页")
ui.addSpinner("第三页","单选框1",{"选项1", "选项2", "选项3"},0)
ui.addButton("第三页","btn1","点击她3", 250, 50)--创建一个按钮
ui.setOnClick("btn3","nl()")
ui.addButton("第三页","btn999","保存",-1,60)
ui.setOnClick("btn999","onClick()")
ui.show("第三页")
end
function 路径获取()
ui.newLayout("第一页")
ui.addSpinner("第一页","单选一",{"选项1", "选项2", "选项3"},0)
ui.addButton("第一页","btn1","点击我1", 250, 50)
ui.setOnClick("btn1","nl()")
ui.addButton("第三页","btn998","保存",-1,60)
ui.setOnClick("btn998","onClick()")
ui.show("第一页")
end
function 路径获取2()
ui.newLayout("第二页")
ui.addSpinner("第二页","单选框二",{"选项1", "选项2", "选项3"},0)
ui.addButton("第二页","btn2","点击他2", 250, 50)--创建一个按钮
ui.setOnClick("btn2","路径获取3()")--设置控件单击事件 如果这里点击就调用路径获取3函数
ui.addButton("第三页","btn997","保存",-1,60)
ui.setOnClick("btn997","onClick()")
ui.show("第二页")
end
local isUi =true
ui.newLayout("首页")
ui.addButton("首页","btn1","点击1")
ui.addButton("首页","btn2","点击2")
ui.setOnClick("btn","路径获取()")
ui.setOnClick("btn2","路径获取2()")
ui.show("首页",false)
ui.loadProfile("/sdcard/test.txt")
i=0
while isUi do
sleep(1000)
i=i+1
if i >=70 then
break
end
toast("UI倒计时"..70-i.."秒")
end
local ret = ui.getData()
ui.dismiss("cloud")
print(ret)
return ret
end
uiset() |