Android WebView背景颜色问题
我有一个webview,其中显示一些html文本,对于同一个webview,我在xml和in中都将背景颜色设置为白色 Java 类。我的问题是,如果文本很短,则只有屏幕上有文本的部分以白色背景色显示,之后网络视图的其余部分以黑色背景颜色显示。请帮忙。
I have a webview in which I am showing some html text, for the same webview I have put background color as white both in xml and in the Java class. My problem is that if the text is short, only the part of the screen which has text appears with background color as white and after that the rest of the webview appears with black background color. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否更改了布局高度和重量以填充父级?
webview 也是其他布局的子级吗?它的属性也会影响 Web 视图的布局参数。
Have you changed the layout height and weight to fill parent ?
Also is the webview child of some other layout? It's properties also affect the layout parameters of the web view.
您似乎使用的是 RGB 而不是 ARGB。零阿尔法。
You seem to be using RGB instead of ARGB. Zero alpha.