Android ScrollView在内容过多时自动翻滚到最底部

        final ScrollView sll_handle = findViewById(R.id.sll_handle);
        sll_handle.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                sll_handle.post(new Runnable() {
                    public void run() {
                        sll_handle.fullScroll(View.FOCUS_DOWN);
                    }
                });
            }
        });

HTML5中的textarea 自动到底部
店家属性:
1.onpropertychange=”this.scrollTop = this.scrollHeight ”
2.onfocus=”this.scrollTop = this.scrollHeight”

        <textarea id="log-textarea" readonly=readonly placeholder="数据log"
            onpropertychange="this.scrollTop = this.scrollHeight "
            onfocus="this.scrollTop = this.scrollHeight">

猜你喜欢

转载自blog.csdn.net/male09/article/details/78773399