Code example for ScrollView

Methods: getScrollY, post

0
        Flinger() { 
            scroller = new Scroller(Scoller.this);
        } 
 
        void start(int distance) {
            int initialy = bannerScrollView.getScrollY();
            scroller.startScroll(0, initialy, 0, distance - initialy, 400);
            //TODO:了解view的post方法意义。 
            bannerScrollView.post(this);
        } 
 
        public void run() { 
            if (scroller.isFinished()) {
                bannerLayout.removeViewAt(0);
                return; 
            } 
 
            boolean more = scroller.computeScrollOffset();
            int y = scroller.getCurrY();
            bannerScrollView.scrollTo(0, y);
            if (more) {