diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets index 32ac65e2fa39fcbd358fc809e6c8f229ed925a51..93928f3de584680222844189efe04b4c939b38dc 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets @@ -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 = { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets index 01f8c565be0584154a7ceab1fad46c4a1554089d..bbecbe823fc6a9b87af8c03ea9db6aba69453818 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets @@ -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)