我正在使用 webview 在 android 应用程序中显示 html 页面。我在滚动时遇到困难,因此使用了滚动视图并将 div 的高度设置为 auto style=”height:auto;”。完美解决了滚动问题。
但是,这导致了另一个问题,因为 div 的高度设置为 auto,如果 div 为 200px,则标签后面不会出现任何内容。这意味着只要 div 小于屏幕的高度,屏幕的其余部分就是黑色的。有什么办法可以将屏幕空白部分的背景设置为白色吗?谢谢。
I am using webview to display html pages in an android application. I was having difficulty with scrolling so used scrollview and set the height of the div to auto style=”height:auto;”. That solved the scrolling issue perfectly.
However, this led to another issue that because the height of the div is set to auto, if the div is say 200px, then nothing appears after the tag. This means that whenever the div is less than the height of the screen the remainder of the screen is black. Is there any way to set the background of the empty part of the screen to white instead? Thanks.
发布评论
评论(1)
我回来了,我终于找到了一个解决方案 - 通常,它很简单,但希望其他人可以从中受益。
基本上我所要做的就是在 main.xml 文件中将背景从黑色更改为白色,如下
android:background="#ffffff"
就是这样!
I am back and i finally found a solution - typically, it was simple but hopefully someone else can benefit from it.
basically all I had to do was in the main.xml file change the background from black to white as follows
android:background="#ffffff"
and that was that!