Android Webview - Detecting the header name as the user scrolls

前端 未结 1 835
轮回少年
轮回少年 2021-01-26 09:19

I have html files in this pattern.


First Heading

Some Text goes here
<
1条回答
  •  深忆病人
    2021-01-26 09:41

    I would use javascript on a setInterval() to monitor when the header was in view by tracking the window.scrollY and comparing it to the page position of the header (which you should likely calculate and cache). Hints on page position here. After that, update the URL of the window from javascript, and track it via your WebViewClient's methods, and you should be all set.

    0 讨论(0)
提交回复
热议问题