2012-06-12 10 views
6


मेरे पास एक HTML संपत्ति है जो एंड्रॉइड में एक वेबव्यू के लिए धन्यवाद दिखाती है। वर्तमान ब्राउज़रों के साथ अच्छी तरह से दिखाया गया है, लेकिन एंड्रॉइड 2.1 जैसे पुराने ब्राउज़र के साथ आप छवियों में जो देखते हैं उसे चला जाता है।

First image of my appFailएक वेबव्यू के अंदर एक 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> 


जावा

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); 
    } 
} 


मैं इसे कैसे ठीक करने के लिए पता नहीं है। मैंने परत, सीएसएस, div, शैलियों को बदलने की कोशिश की है ... जो कुछ मेरे साथ हुआ है। क्या कोई हुआ? आपने कैसे प्रबंधित किया? कृपया

+0

स्क्रीन पर गलत दिखाई देने वाला पाठ स्क्रीन पर कैसे दिखाया जाता है? और आप इसे करने के लिए क्या करने की कोशिश कर रहे हैं? क्या आप थोड़ा सा स्पष्टीकरण दे सकते हैं। – Charlie

+0

हाय। जब ग्रंथों में से एक प्रकट होता है, तो नीचे दिए गए, स्क्रीन पर बने रहेंगे जहां आप थे और टेक्स्ट उनके ऊपर स्क्रॉल किया गया था। इस पाठ को पाठ के नीचे प्रदर्शित किया जाना चाहिए पीछे नहीं है। मुझे उम्मीद है कि मैंने समझाया है ;-) –

+0

तो मूल रूप से वे ओवरलैपिंग कर रहे हैं? – Charlie

उत्तर

0

सहायता करें क्या आप वाकई अपने जेएस के साथ कोई समस्या नहीं है?

यहाँ यह में अपने कोड के साथ एक बेला है: http://jsfiddle.net/8wsvu/

एक Android समारोह है शुद्ध जे एस में show() समारोह, या यह जे एस माना जाता है? मैं जेएस में अभी तक इतना अच्छा नहीं हूं कि यह पता है कि यह क्या है, लेकिन इसे गुगल करने से यह जेएस फ़ंक्शन होने के लिए कोई परिणाम नहीं निकला।

मेरा दूसरा अनुमान यह है कि यह क्यों गलत है, क्योंकि div एक दूसरे के शीर्ष पर पूर्ण स्थान पर हैं।

यदि आप पृष्ठ पर तत्वों को दिखाने और छिपाने के लिए jQuery का उपयोग कर सकते हैं, तो यह बहुत आसान होगा।

+0

मैंने jquery और simple div के साथ प्रयास किया है, यानी, एक div के अंदर कोई अन्य नहीं है। अभी भी एंड्रॉइड 2.1 और उससे नीचे टर्मिनलों पर जा रहा है। धन्यवाद –

+0

हाय, दोस्तों। किसी को पता है कि अगर मैं html5 द्वारा html बदल रहा हूं, तो यह समस्या हल हो गई है? धन्यवाद –

+0

क्या मेरा उत्तर आपकी मदद करता है? यदि हां, तो इसे ऊपर उठाएं, और इसे स्वीकार करें। – Charlie

संबंधित मुद्दे