且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

保存的WebView Android SDK中内的图像

更新时间:2023-11-21 14:16:28

我还没有实际使用此发挥各地还没有,但是从文件看来你至少有两个(非德precated)选项:

I haven't actually played around with this yet, but from the docs it appears you have at least two (non-deprecated) options:


  1. getHitTestResult()

  2. requestImageRef(消息MSG)

根据文档,你可以使用第一个选项,以测试 IMAGE_TYPE 的结果,和URL的图像提供,以及:

According to the documentation you can use the first option to test for IMAGE_TYPE as result, and a url to the image is provided as well:

如果找到了HTML :: img标签,该HitTestResult类型设置为
  IMAGE_TYPE和URL设置中的额外字段。

If a HTML::img tag is found, the HitTestResult type is set to IMAGE_TYPE and the url is set in the "extra" field.

第二个选项会给你一个类似的结果:

The second option will give you a similar result:

请求图像的URL最后由用户触摸。味精会
  发送到其目标以字符串重新presenting URL作为它的对象。

Request the url of the image last touched by the user. msg will be sent to its target with a String representing the url as its object.

不知道如果这些选项都以长按太虽然兼容。

Not sure if these options are compatible with a 'long click' too though.

另外,你怎么心里有链接点击一个按钮到一个特定的形象?根据您的这个解决方案,您还可以简单地使用捕获所有加载图片资源 onLoadResource(的WebView视图,字符串URL) ,建立图像引用的列表,并下载按钮,点击是指太之一。

Alternatively, how did you have in mind to link clicking a button to a specific image? Depending on your solution for this, you may also be able to simply capture all loaded image resources using onLoadResource(WebView view, String url), build a list of image references and download the one that button click refers too.