【问题标题】:WebView.getProgress() always returning 100WebView.getProgress() 总是返回 100
【发布时间】:2010-10-19 01:24:21
【问题描述】:

我遇到了这里报告的相同错误 (http://code.google.com/p/android/issues/detail?id=9597)

有人知道解决方法吗?我想在页面加载时像 ​​Android 浏览器一样在 WebView 中有一个进度条。

【问题讨论】:

    标签: android progress-bar webview


    【解决方案1】:

    您需要实现WebChromeClient 以使用onProgressChanged() 方法捕获进度更改:

    http://developer.android.com/reference/android/webkit/WebChromeClient.html#onProgressChanged(android.webkit.WebView, int)

    查看这个问题的答案:Android WebView progress bar

    您实际上可以在 WebView 文档中看到一个示例:http://developer.android.com/reference/android/webkit/WebView.html

    【讨论】:

      猜你喜欢
      • 2015-04-09
      • 1970-01-01
      • 2016-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多