未验证 提交 5d7b32cf 编写于 作者: O openharmony_ci 提交者: Gitee

!7335 modify onScrollBegin to onScrollFrameBegin

Merge pull request !7335 from yeyinglong/scroll
......@@ -98,13 +98,13 @@ struct ListLanes {
.alignListItem(ListItemAlign.Start)
.border({ width: 3, color: Color.Red })
.lanes({ minLength: 40, maxLength: 60 })
.onScrollBegin((dx: number, dy: number) => {
if ((this.listPosition == 0 && dy >= 0) || (this.listPosition == 2 && dy <= 0)) {
this.scroller.scrollBy(0, -dy)
return { dxRemain: dx, dyRemain: 0 }
.onScrollFrameBegin((offset: number, state: ScrollState) => {
if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) {
this.scroller.scrollBy(0, -offset)
return { offsetRemain: 0 }
}
this.listPosition = 1;
return { dxRemain: dx, dyRemain: dy }
return { offsetRemain: offset }
try {
var backData = {
......
......@@ -61,9 +61,9 @@ struct ScrollOnScrollBegin {
}.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.onScrollBegin((dx: number, dy: number) => {
console.info('dx=' + dx + ",dy=" + dy)
return { dxRemain: dx, dyRemain: dy }
.onScrollFrameBegin((offset: number, state: ScrollState) => {
console.info('offset=' + offset)
return { offsetRemain: offset }
})
.scrollBar(BarState.On)
.scrollBarColor(Color.Gray)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册