`
mickey_hou
  • 浏览: 240043 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

auto scroll scrollview

阅读更多
private void autoScroll()
    {
        this.scrollView = (ScrollView) findViewById(R.id.contentAreasss);//scroll对象
        this.mlayout = (LinearLayout) findViewById(R.id.contentArea);//scrollView中包含
        mHandler.post(ScrollRunnable);
    }
   
    private Runnable ScrollRunnable = new Runnable()
    { 
        public void run()
        { 
            int off = mlayout.getMeasuredHeight() - scrollView.getHeight();//判断高度                      
            if (off > 0)
            { 
                scrollView.scrollTo(0, off);  
            } 
        } 
    };
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics