本帖最后由 17895955997 于 2022-4-30 09:32 编辑
function onLoadEvent(handle)
end
function onClickEvent(handle,id)
text1 = getEditText(handle,"idEdit_user")
text2 = getEditText(handle,"idEdit_pwd")
print("idEdit_user text is:"..text1)
print("idEdit_user text is:"..text2)
if id=="idButton1"then
onLoadEvent(handle)
写入()
print("点击增加")
elseif
id=="idButton2"then
print("点击了删除")
end
end
function onCloseEvent(handle)
end
function onSelectEvent(handle,id,idx,sel)
end
local txt1="/mnt/sdcard/aa/a.txt"
function 写入()
if fileExist(txt1) then
local ret1=io.write(txt1,(text1)..","..(text2).."\n")
print("写入用户:"..io.read(txt1))
end
end
action,arr = showUIEx("UI-test1.ui",100,100,600,600,onLoadEvent,onClickEvent,onCloseEvent,onSelectEvent)
print("打开后的用户名:"..arr.idEdit_user)
for i, v in pairs(arr) do
print("key:==>"..i.." val:==>"..v)
end
|