好像刷新UI的话  要借助Handler

解决方案 »

  1.   

    使用 postInvalidate方法,重绘UI.
      

  2.   

    private void scrollToEnd() {
            new Handler().post(new Runnable() {
                public void run() {
                    try {
                        Thread.sleep(10);
                        int left = linearLayout.getMeasuredWidth() - horizontalScrollView.getWidth();
                        if(left < 0) {
                            left = 0;
                        }
                        horizontalScrollView.scrollTo(left, 0);
                    } catch(Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
    此乃正解,不过仍感谢各位!!
      

  3.   

    private void scrollToEnd() {
            new Handler().post(new Runnable() {
                public void run() {
                    try {
                        Thread.sleep(10);
                        int left = linearLayout.getMeasuredWidth() - horizontalScrollView.getWidth();
                        if(left < 0) {
                            left = 0;
                        }
                        horizontalScrollView.scrollTo(left, 0);
                    } catch(Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
    此乃正解,仍然感谢各位!!!