Skip to main content
版本:v3

PAGE_INDICATOR

API_LEVEL 2.1 开始支持,API 兼容性请参考 API_LEVEL

页面指示器,指示当前页面位置。

创建 UI 控件

import { createWidget, widget } from '@zos/ui'

const scrollBar = createWidget(widget.PAGE_INDICATOR, Param)

Param: object

属性说明是否必须类型API_LEVEL
x控件 x 坐标number2.1
y控件 y 坐标number2.1
w控件宽度number2.1
h控件高度number2.1
align_h水平对齐方式number2.1
h_space水平间距number2.1
v_space垂直间距number3.0
select_src指示器当前高亮图标路径string2.1
unselect_src指示器未选中图标路径string2.1
horizontal是否水平布局,默认 true,设置 false 为垂直布局boolean3.0

完整示例

import { createWidget, widget, align } from '@zos/ui'

const pageIndicator = createWidget(widget.PAGE_INDICATOR, {
x: 0,
y: 470,
w: 480,
h: 100,
align_h: align.CENTER_H,
h_space: 8,
select_src: 'images/test/select/select.png',
unselect_src: 'images/test/select/unselect.png'
})