PictureListener 和 onNewPicture() 已弃用 - 替代方案?
Android 开发人员参考< /a> 表示 WebView.PictureListener
接口及其 onNewPicture()
方法均已弃用。
很好,但是仍然需要知道 WebView 何时渲染图片。有没有其他方法可以实现这一目标?
The Android Developers reference says that both the WebView.PictureListener
interface and its onNewPicture()
method are deprecated.
Fine, but the need to know when WebView renders a picture is still there. Is there an alternative way to accomplishing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好吧,仔细检查 API 后,如果不使用 PictureListener 似乎无法完成此操作。显然,反对此功能的人没有提供替代方案。
我建议您写一份错误报告 http://code.google.com/p/android/issues 并询问人们在这里给它加注星标。
以马内利
Ok after careful review of the APIs, it seems this cannot be done without using PictureListener. Obviously the person who deprecated this feature didn't provide an alternative.
I suggest you write a bug report http://code.google.com/p/android/issues and ask people here to star it.
Emmanuel
我提交了这个 Android 问题来跟踪 PictureListener 和 onNewPicture() 回调的替换。
http://code.google.com/p/android/issues/detail ?id=38646
请根据需要加注星标。
I submitted this Android issue to track the replacement for the PictureListener and onNewPicture() callback.
http://code.google.com/p/android/issues/detail?id=38646
Please star as necessary.
最接近的是 onPageFinished
但它并不总是在内容绘制完成后触发,因此没有太多的替代。我建议坚持使用 onNewPicture,即使它已被弃用。毕竟,它仍然有效。
the closest thing you have is onPageFinished
but it doesn't always trigger after the content is finished being drawn, hence not so much of a replacement. I suggest sticking to onNewPicture even if it is deprecated. after all, it still works.
在出现此功能的官方替代 API 之前,您只需将
AndroidManifest.xml 中的 更改为 <= 13 的任何内容。
Until there is an official replacement API for this functionality you can just change the
in AndroidManifest.xml to anything <= 13.