utb Toolbar工具栏设置
2022-12-22 14:26:23 最后更新
用法:

--设置自定义的工具栏 为当前界面的工具栏
--输入Toolbar工具栏的 控件id或控件对象
i:utb(3)

--绑定侧滑控件,侧滑控件内需要包含左侧滑,绑定后可以在Toolbar工具栏的左图标 控制左边侧滑
--输入Toolbar工具栏的 控件id或控件对象,输入侧滑的 控件id或控件对象
i:utb(3, 2)

--设置参数

i:utb("set", "dshe", true)

--设置左图标,可以设置事件监听
i:utb("left", 3, "@a.png")

--设置左图标的点击事件,注意此代码需在 i:utb(id) 后,否则事件将无效。
i:utb("set", "leftck", 3,

function(v)

--系统赋值
syso(v)
end
)

--设置右菜单图标,无事件。可使用界面菜单事件
i:utb("right", 3, "@b.png")

--标题
i:utb("set", "title", "apptitle")

--子标题
i:utb("set", "subtitle", "appsubtitle")

--自定义布局可输入View类型布局
i:utb("set", "cv", v)

--显示选项
i:utb("set", "do", 0)

--显示或隐藏 标题
i:utb("set", "dste", true)

--显示或隐藏 自定义布局
i:utb("set", "dsce", true)

--显示或隐藏 主页图标
i:utb("set", "dshe", true)

--获取参数

--标题
local c = i:utb("get", "title")

--子标题
local c = i:utb("get", "subtitle")

--自定义布局可输入View类型布局
local c = i:utb("get", "cv")

--显示选项
local c = i:utb("get", "do")

--动作栏布局高度
local c = i:utb("get", "height")

说明:
常用于设计应用顶部工具栏。