The nuance is that I need to make a sweep, for example, to the bottom of a specific WebView, but the data in the WebView is loaded after creating the markup, and apparently because of this, the ScrollView data on the size of the layout elements is incorrect / irrelevant, so either it’s not scrolling at all, or scrolls to a shorter length than the item with loaded content. Tell me how to handle a scroll in such a situation, if at all possible? Or, perhaps, how to update the status of the children of ScrollView? Although I should have a click on the button, but for verification I tried to scroll immediately after downloading the content like this:

mWebView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mWebView.scrollTo(0, 2000); } } 

And the result is zero. Maybe someone will throw at least some direction where to dig, how to overcome this problem? webview don’t need to scroll webview itself; all content can fit in a few lines; ScrollView should be ScrollView to the height of a specific webview or to the bottom of a specific webview , that is, it is normal for scrollView.scrollTo(0, myWebView.getBottom()) or scrollView.scrollTo(0, myWebView.getContentHeight())

  • @VAndrJ, a sensible idea, I will try, and how does a smoothScrollTo differ from the usual scrollTo, can you tell me? - Ghost
  • Yes, the same thing, but not sharply jumping into the right place, but relatively smoothly scrolls. - VAndrJ
  • one
    If you need to scroll through the ScrollView , why do you scroll through the WebView ? - Vladyslav Matviienko
  • @VAndrJ, thanks for the help, delayed scrolling works! - Ghost
  • @metalurgus, but the truth is, by the night something completely doesn’t work for the brains, and I’ll probably try to apply the example as a worker as a whole, too. - Ghost

1 answer 1

Make a delayed scrolling, maybe something does not have time. As an example:

 scrollView.postDelayed(new Runnable() { @Override public void run() { scrollView.smoothScrollTo(0, myWebView.getBottom()); } }, 300);