private Scroller scroller;
scroller = new Scroller(context);
scroller.startScroll(getScrollX(), getScrollY(), -getScrollX(), - getScrollY());
invalidate();
----------
@Override
public void computeScroll() {
if(scroller.computeScrollOffset()){
scrollTo(scroller.getCurrX(),scroller.getCurrY());
invalidate();
}
}
Scroller
最新推荐文章于 2024-09-03 18:14:10 发布