更改 webView 中的文本颜色
有没有办法改变整个 webView 的文本颜色? 如果是的话你能给我一些例子吗?
Is there a way to change the text color for entire webView?
If it is could you provide me with some examples?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Web 视图显示网页,因此请按照与任何网页相同的方式进行操作:定义 CSS 样式(内联或在外部引用的样式表中):
...然后将使用所有文本呈现页面指定的颜色。这是有效的,因为 * 选择器适用于所有元素 和 color 属性指定文本颜色。
A web view displays a web page, so do it the same way you would do it for any web page: define a CSS style (inline or in an external, referenced stylesheet):
... then the page will be rendered with all text the designated color. This works because the * selector applies to all elements and the color property specifies the text color.
这可以通过 javascript 轻松实现
It's easily doable from javascript