Reduce speed of smooth scroll in scroll view

后端 未结 5 1046
栀梦
栀梦 2021-02-03 19:44

I have a scroll View. I performed smooth-scroll.using smoothScrollBy().It all works fine, but I want to change the duration of the smooth-scroll. Smooth-scroll happens very fast

5条回答
  •  你的背包
    2021-02-03 20:17

    whichScreen = Math.max(0, Math.min(whichScreen, getBase().getDocumentModel().getPageCount()-1));
    mNextScreen = whichScreen;
    final int newX = whichScreen * getWidth();
    final int delta = newX - getScrollX();
    //scroller.startScroll(getScrollX(), 0, delta, 0, Math.abs(delta) * 2);
    scroller.startScroll(getScrollX(), 0, delta, 0, Math.abs(delta));
    invalidate();
    

提交回复
热议问题