类: BtnMatrix
约 596 字大约 2 分钟
2024-05-03
构建固件和导入到JS
BtnMatrix 类由 lv 模块提供:
import { BtnMatrix } from 'lv'简介
按钮矩阵控件
以网格排布多个按钮,比独立按钮更节省内存
该类是对 LVGL Widget
lv_buttonmatrix_t的封装,具体用法请参考 LVGL 文档
继承自 Obj,拥有 Obj 的全部属性、方法和事件。
示例:
import * as lv from "lv"
const obj = new lv.BtnMatrix(lv.screen())类属性
属性 selectedButton
类型: number
访问: 可读, 可写
该属性是对 LVGL C API
lv_buttonmatrix_get_selected_button,lv_buttonmatrix_set_selected_button的封装, 具体用法请参考 LVGL文档
属性 buttonCtrlAll
类型: LV-CONST
访问: 只写
该属性是对 LVGL C API
lv_buttonmatrix_set_button_ctrl_all的封装, 具体用法请参考 LVGL文档
属性 oneChecked
类型: number
访问: 可读, 可写
该属性是对 LVGL C API
lv_buttonmatrix_get_one_checked,lv_buttonmatrix_set_one_checked的封装, 具体用法请参考 LVGL文档
属性 popovers
类型: number
访问: 只读
该属性是对 LVGL C API
lv_buttonmatrix_get_popovers的封装, 具体用法请参考 LVGL文档
类方法
方法 setButtonCtrl
原型: setButtonCtrl ()
该方法是对 LVGL C API
lv_buttonmatrix_set_button_ctrl的封装,具体用法请参考 LVGL文档
返回值:
undefined
方法 clearButtonCtrl
原型: clearButtonCtrl ()
该方法是对 LVGL C API
lv_buttonmatrix_clear_button_ctrl的封装,具体用法请参考 LVGL文档
返回值:
undefined
方法 clearButtonCtrlAll
原型: clearButtonCtrlAll ()
该方法是对 LVGL C API
lv_buttonmatrix_clear_button_ctrl_all的封装,具体用法请参考 LVGL文档
返回值:
undefined
方法 setButtonWidth
原型: setButtonWidth ()
该方法是对 LVGL C API
lv_buttonmatrix_set_button_width的封装,具体用法请参考 LVGL文档
返回值:
undefined
方法 hasButtonCtrl
原型: hasButtonCtrl ()
该方法是对 LVGL C API
lv_buttonmatrix_has_button_ctrl的封装,具体用法请参考 LVGL文档
返回值:
undefined
