是否可以在web视图使用可绘制(而不是图像)? [英] Is it possible to use drawables (not images) in WebView?

查看:78
本文介绍了是否可以在web视图使用可绘制(而不是图像)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
   @android显示/ RES /可视的web视图

是否有可能使用可绘(形状,渐变等)的WebView(里面 IMG 标记)?

Is it possible to use drawables (shape, gradient, etc.) in WebView (inside img tag)?

P.S。我读过这个答案。所以,我知道如何插入图像,但对于其他的可绘制?

P.S. I've read this answer. So, I know how to insert image, but what about other drawables?

修改

例如:我需要显示圆的WebView(不使用画布)

For example: I need to display circle in WebView (without using canvas).

推荐答案

您可以插入的Base64-CN codeD映像的URL中的&lt直接数据; IMG ...>标签。该URL格式为数据: MIMETYPE 的;的base64,数据的。例如参见这里

You can insert Base64-encoded image data directly in the URL for the <IMG...> tag. The URL format is "data:mimetype;base64,data". For example see here.

这篇关于是否可以在web视图使用可绘制(而不是图像)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆