Skip to content

SwitchDemo.lua

zhangxin-it edited this page Dec 24, 2019 · 6 revisions

Switch

copy下面代码,运行试试

switch = Switch()
switch:width(100):height(80):marginLeft(100):marginTop(100)

switch:setSwitchChangedCallback(function(isOn)
    print("switch changed -----", isOn)
    print("switch ----- ", switch:on())
end)

window:addView(switch)
Clone this wiki locally