跳到主要内容

增加控件值(:increment)

函数​

返回值 = obj:increment(增量)

参数​

  • 增量 整数型 可选 默认 1

返回值​

  • 返回值 布尔型 如果返回true 表示成功, 如果返回false 表示失败

说明​

该函数可以用于滑块、滚轮等支持增减调节的控件。 每次增加的幅度由目标控件决定。需要精确控制时 此方法只能在 3.0.3以上版本中使用

示例​


--从内存地址加载一个节点 滑动滑块 增加 10个刻度
local res = nodeView.forAddres("0x103592e30"):increment(10)
if (res) then
toast("增加成功")
else
toast("增加失败")
end