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">