Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Web视图中HTML中的分层_Android_Html_Webview - Fatal编程技术网

Android Web视图中HTML中的分层

Android Web视图中HTML中的分层,android,html,webview,Android,Html,Webview,我有一个html资产,这要感谢android中的webview。当前浏览器显示良好,但安卓2.1等较旧的浏览器显示图像中的内容。 我把代码放在万一有人想看的地方。 HTML <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="


我有一个html资产,这要感谢android中的webview。当前浏览器显示良好,但安卓2.1等较旧的浏览器显示图像中的内容。


我把代码放在万一有人想看的地方。
HTML

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Documento sin título</title>
    <script>
        function show(divactual,textactual) {
            if(document.getElementById(divactual).style.display == "block"){
                document.getElementById(divactual).style.display = "none";
                document.getElementById(textactual).innerHTML = "show details...";

                }
            else if(document.getElementById(divactual).style.display == "none"){
                document.getElementById(divactual).style.display = "block";
                document.getElementById(textactual).innerHTML = "hidden details...";
                }
        }
    </script>   
    <style type="text/css">
        body{
            background-color:transparent;
            font-family: Verdana, Geneva, sans-serif;
            font-size: 1.0em;
            font-style: normal;
            color:#999999;
            margin:10px;
        }
        body a{
            color:#0CF;
            text-decoration:none;
        }
        #bg {
            z-index: -14;
            width: 100%;
        }
        #letrapequena {
            font-family: Verdana, Geneva, sans-serif;
            font-size: 0.6em;
            color: #00537c;
        }
        #tituloseccion{
            font-family: Verdana, Geneva, sans-serif;
            font-size: 1.5em;
            font-style: normal;
            font-weight: bold;
            color:#7AB800;
        }
        #headtwo{
            font-family: Verdana, Geneva, sans-serif;
            font-size: 1.2em;
            font-style: normal;
            font-weight: bold;
            color:#7AB800;
        }
        #headthree{
            font-size: 1.1em;
            font-style: normal;
            font-weight:bold;
            color:#00537C;
        }
        #container{
            background-color:#D8F7FE;
            margin:10px 0;
            color:#00537c;
            font-weight:bold;
        }
    </style>
  </head>
  <body style="background-color:transparent;">
    <div id="tituloseccion">
        Titleone
    </div>
    <hr align="left" width="90%" size="0.1em" color="#999999">
    <div id="headtwo">titletwo</div>
    <div id="bigcontainer" style="display:block;">
        <div id="headthree">titlethree</div>
        <div id="generalcont" style="display:block;">
            <div id="container" style="display:block;">
                <div style="display:inline">parrone&nbsp;&nbsp;&nbsp;</div>
                <div style="display:inline;">
                    <a href="javascript:show('info1','text1');" id="text1">show datails...</a>
                </div>
            </div>
            <div  id="info1" style="display:none;" >
                text text text text text text text text 
            </div>
         </div>

        <div id="generalcont" style="display:block;">
            <div id="container" style="display:block;">
                <div style="display:inline">parrtwo&nbsp;&nbsp;&nbsp;&nbsp;</div>
                <div style="display:inline;">
                    <a href="javascript:show('info2','text2');" id="text2">show details...</a>
                </div>
            </div>
            <div  id="info2" style="display:none;" >
                text text text text text text text 
            </div>
        </div>
    </div>
    <div id="letrapequena" style="display:block;">
                text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 
            </div>
  </body>
</html>


我不知道如何修复它。我尝试过改变图层,css,div,样式。。。我所想到的一切。有人出过事吗?你是怎么做到的?请帮助

您确定这不是您的JS的问题吗

这里有一把小提琴,上面有你的代码:

纯JS中的
show()
函数是Android函数,还是应该是JS?在JS中,我还不知道它是否很棒,但在谷歌上搜索它并没有结果,因为它是一个JS函数

我对其分层错误的第二个猜测是因为
div
绝对位于彼此之上


如果可以使用jQuery显示和隐藏页面上的元素,这将简单得多。

屏幕上如何显示错误的文本?你想让它做什么?你能澄清一下吗。当其中一个文本展开时,下面的文本将保留在您所在的屏幕上,并在其上滚动文本。此文本应显示在文本不后面的下方。我希望我已经解释过;-)所以基本上它们是重叠的?是的,当我点击hidden/show Details时,它们是重叠的。我用jquery和simple div尝试过,也就是说,在一个div中没有其他的。仍在使用android 2.1及以下版本的终端。谢谢,伙计们。有人知道如果我用html5修改html,这个问题就解决了吗?谢谢你,查理。你的回答没有帮助:-(.问题仍在发生。因此,我询问更改html5是否可以解决问题。非常抱歉花了这么长时间。问题已在使用html5的某些终端上得到解决,但在其他终端上问题仍在继续。这些终端有旧版本的浏览器。我想这就是问题所在。非常感谢您的帮助。请确保如果回答了您的问题,请将此标记为您的答案。
 package es.ibys.prueba.webview;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.webkit.WebView;

public class PruebawebviewActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        WebView myWview = (WebView) findViewById(R.id.webview);

        String miurl = "file:///android_asset/index2.htm";
        myWview.getSettings().setJavaScriptEnabled(true);
        myWview.setBackgroundColor(Color.TRANSPARENT);
        myWview.loadUrl(miurl);
    }
}