- scroller定义
private Scroller mScroller;
mScroller = new Scroller(context);
- startScroll
mScroller.startScroll(startX, startY, dx, dy);
invalidate();
- computeScroll
@Override
public void computeScroll() {
if (mScroller.computeScrollOffset()) {
scrollTo(0, mScroller.getCurrY());
invalidate();
}
}
网友评论