scrollview smoothScrollTo不起作用的问题

LinearLayout ll = (LinearLayout) findViewById(R.id.ll);

        final ScrollView hsv = (ScrollView) findViewById(R.id.hsv);
        OnGlobalLayoutListener listener = new OnGlobalLayoutListener() {

            @Override
            public void onGlobalLayout() {
                hsv.scrollTo(100, 0);
            }
        };
        ll.getViewTreeObserver().addOnGlobalLayoutListener(listener);

猜你喜欢

转载自blog.csdn.net/weixin_35677874/article/details/52757076