-
Notifications
You must be signed in to change notification settings - Fork 207
LoadingDemo.lua
zhangxin-it edited this page Dec 24, 2019
·
5 revisions
copy下面代码,运行试试
timer = Timer()
timer:repeatCount(1)
timer:interval(3.0)
startView = Label()
startView:text('开始')
startView:textAlign(TextAlign.CENTER)
startView:setGravity(Gravity.CENTER_HORIZONTAL)
startView:bgColor(Color(222, 20, 232, 1))
startView:width(80):height(30):marginTop(100)
startView:onClick(function()
print('timer ---- start')
Loading:show()
timer:start(function()
Loading:hide()
timer:stop()
print('timer ----- stop')
end)
end)
window:addView(startView)
timer2 = Timer()
timer2:repeatCount(1)
timer2:interval(2.0)
timer2:start(function()
print("timer2 ----- start")
Loading:show()
end)
timer3 = Timer()
timer3:repeatCount(1)
timer3:interval(5.0)
timer3:start(function()
print("timer3 ----- stop")
timer2:stop()
Loading:hide()
end)