开发者

Android WebView scroll down

Is there a method or something to scroll de WebView at the bottom of the page.. I am using a WebView in a chat client as chatboard, and I want to scroll the page down as the user writes some text...

开发者_开发百科

Thank you very much.


At Webview's reference.

public boolean pageDown (boolean bottom)

Since: API Level 1 Scroll the contents of the view down by half the page size.

Parameters: bottom true to jump to bottom of page.

Returns true if the page was scrolled

Does this work for you?


   public void scrollToBottom(boolean animate) {
        if (animate) {
            pageDown(true);
        } else {
            scrollTo(getScrollX(), computeVerticalScrollRange());
        }
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜