android控件WebView处置frameset时背景不能透明
android控件WebView处理frameset时背景不能透明
这个问题,不知道该去android吧还是在HTML吧发,所以还是都发了...
就是写了两个HTML,如下:
other.html
<html>
<body style="background-color:transparent;width:200px;height:150px;" >
<h1>This is other, Arthur!</h1>
<h1>This is other, Arthur!</h1>
<h1>This is other, Arthur!</h1>
<h1>This is other, Arthur!</h1>
</body>
</html>
****************************************************
index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Channel</title>
<style type="text/css">
.RightBackground{
background-color: transparent;
}
</style>
</head>
<frameset rows="0,100" frameborder="no" border="0" framespacing="0">
<frame allowTransparency="true" class="RightBackground" src="other.html" name="CTRL" id="CTRL"/>
</frameset><noframes></noframes>
</html>
****************************************************
然后,用WebView来显示index.html,背景是白的...我在WebView后面放了一个imageview,结果imageview就被挡住了。
mWebView.setBackgroundColor(0);
mWebView.loadUrl("file:///sdcard/index.html");
而我用其它浏览器(chrome、ie、opera)来跑index.html,直接什么的不显示
------解决方案--------------------
控件遮挡控件是肯定的,你想前面还有个WebView,加载半透明页面,让后面的ImageView显示出来是吧,这个思路有点问题,我觉得不然直接添加WebView的透明属性较好,,,
这个问题,不知道该去android吧还是在HTML吧发,所以还是都发了...
就是写了两个HTML,如下:
other.html
<html>
<body style="background-color:transparent;width:200px;height:150px;" >
<h1>This is other, Arthur!</h1>
<h1>This is other, Arthur!</h1>
<h1>This is other, Arthur!</h1>
<h1>This is other, Arthur!</h1>
</body>
</html>
****************************************************
index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Channel</title>
<style type="text/css">
.RightBackground{
background-color: transparent;
}
</style>
</head>
<frameset rows="0,100" frameborder="no" border="0" framespacing="0">
<frame allowTransparency="true" class="RightBackground" src="other.html" name="CTRL" id="CTRL"/>
</frameset><noframes></noframes>
</html>
****************************************************
然后,用WebView来显示index.html,背景是白的...我在WebView后面放了一个imageview,结果imageview就被挡住了。
mWebView.setBackgroundColor(0);
mWebView.loadUrl("file:///sdcard/index.html");
而我用其它浏览器(chrome、ie、opera)来跑index.html,直接什么的不显示
------解决方案--------------------
控件遮挡控件是肯定的,你想前面还有个WebView,加载半透明页面,让后面的ImageView显示出来是吧,这个思路有点问题,我觉得不然直接添加WebView的透明属性较好,,,