Hello. Such a question: is it possible to scroll through the site in a webView through the code and fix there. Since the site has a form that must be filled, but it is at the bottom and so that the user does not guess what, just scroll to the form and fix it. Is it possible?

  • one
    And why not cut a piece with the form of the page and display it in a WebView? - mit
  • Here it is possible and so, but could not tell you in more detail how can this be done? - Kirill Goncharov
  • Android has something to do with it? This is done using standard js tools. - Suvitruf
  • I just do not have access to the site itself. - Kirill Goncharov

1 answer 1

You can scrollTo through using the scrollTo method, and fix it by disabling further scrolling. I think this can be done like this:

 // скроллим в конец страницы webView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { view.scrollTo(0, view.getContentHeight()); } }); // отключаем возможность скрола для пользователя webview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return (event.getAction() == MotionEvent.ACTION_MOVE); } }); 
  • Thanks a lot! - Kirill Goncharov