提交 294a1652 编写于 作者: T tomkl123

gird scroll bar示例代码修改

Signed-off-by: Ntomkl123 <wangyansong11@huawei.com>
Change-Id: Ic9ac92dc4d167c8f25df164a40fccfac806995de
上级 f3dc2845
...@@ -187,11 +187,12 @@ struct GridExample { ...@@ -187,11 +187,12 @@ struct GridExample {
.columnsGap(10) .columnsGap(10)
.rowsGap(10) .rowsGap(10)
.edgeEffect(EdgeEffect.Spring) .edgeEffect(EdgeEffect.Spring)
.scrollBar(BarState.On)
.onScrollIndex((first: number) => { .onScrollIndex((first: number) => {
console.info(first.toString()) console.info(first.toString())
}) })
.onScrollBarUpdate((index: number, offset: number) => { .onScrollBarUpdate((index: number, offset: number) => {
return {totalOffset: (index / 5) * (80 + 10) - 10 - offset, totalLength: 80 * 5 + 10 * 4} return {totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4}
}) })
.width('90%') .width('90%')
.backgroundColor(0xFAEEE0) .backgroundColor(0xFAEEE0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册