2012-06-21 14 views
8

मेरे पास एक एंड्रॉइड एप्लिकेशन है जिसमें खोज के लिए टेक्स्ट बॉक्स, कुछ बटन, वेबव्यू (1 दृश्य 2 अदृश्य) और एक एडोब एडव्यू है। ऐप सिर्फ कुछ विशेष साइटों पर खोज करता है और यह एम्यूलेटर, सैमसंग गैलेक्सी डिवाइस पर बहुत अच्छा काम करता है। लेकिन मुझे एचटीसी वन एक्स के साथ समस्या है (अन्य एचटीसी मॉडल के बारे में नहीं पता)।एचटीसी वन एक्स - वेबव्यू स्पर्श के बाद सफेद/खाली हो जाता है

समस्या यह है कि, जब आप एक खोज बटन पर क्लिक करते हैं, तो वेबव्यू पृष्ठ लोड करता है। फिर "कभी-कभी" जब आप स्क्रॉलिंग के लिए भी स्पर्श करने का प्रयास करते हैं, तो वेबव्यू बस स्क्रॉल बार के साथ पूरी तरह से सफेद क्षेत्र में लौटता है। यह विशेष रूप से विज्ञापन रीफ्रेश के बाद होता है। यहां तक ​​कि कभी-कभी विज्ञापन की पृष्ठभूमि और टेक्स्ट क्षेत्र पूरी तरह से सफेद हो जाता है-इसलिए पठनीय भी नहीं। विज्ञापन पर सिर्फ नीले तीर और नीले फोन कॉल छवियां दिखाई देती हैं!

क्या किसी के पास इस तरह कोई समस्या है, और कोई समाधान है? अग्रिम में धन्यवाद।

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#ffffff" 
    android:orientation="vertical" > 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" > 

     <LinearLayout 
      android:id="@+id/layoutDashboard" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical" 
      android:background="@drawable/border_shape" 
      android:orientation="vertical" 
      android:paddingTop="1sp" > 

      <EditText 
       android:id="@+id/editxtKeyword" 
       android:layout_width="fill_parent" 
       android:layout_height="43dp" 
       android:layout_marginLeft="1dp" 
       android:layout_marginRight="1dp" 
       android:layout_marginTop="2dp" 
       android:ems="10" 
       android:hint="@string/editxtKeyword_hint" 
       android:singleLine="true" > 
      </EditText> 

      <HorizontalScrollView 
       android:id="@+id/horizontalScrollView1" 
       android:layout_width="fill_parent" 
       android:layout_height="0dip" 
       android:layout_gravity="center_vertical" 
       android:layout_weight="0.30" 
       android:paddingBottom="2dp" 
       android:paddingLeft="1dp" 
       android:scrollbars="none" > 

       <LinearLayout 
        android:id="@+id/layoutButtons" 
        android:layout_width="wrap_content" 
        android:layout_height="fill_parent" 
        android:layout_gravity="center_vertical" 
        android:layout_marginTop="0dp" 
        android:layout_marginBottom="1dp" 
        android:layout_marginLeft="1dp" 
        android:layout_marginRight="1dp" 
        android:orientation="horizontal" > 
< 
        <Button 
         android:id="@+id/btnAk" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center_vertical" 
         android:layout_margin="1dp" 
         android:background="@drawable/custom_button_shape" 
         android:text="asd" /> 

        <Button 
         android:id="@+id/btnCm" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center_vertical" 
         android:layout_margin="1dp" 
         android:background="@drawable/custom_button_shape" 
         android:text="csm" /> 

       </LinearLayout> 
      </HorizontalScrollView> 
     </LinearLayout> 

     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" > 

      <WebView 
       android:id="@+id/webV" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_above="@+id/linlaylay1" 
       android:visibility="visible" /> 

      <WebView 
       android:id="@+id/webVAnalytics" 
       android:layout_width="1dp" 
       android:layout_height="0dp" 
       android:visibility="invisible" /> 

      <WebView 
       android:id="@+id/WebVSahibinden" 
       android:layout_width="1dp" 
       android:layout_height="0dp" 
       android:visibility="invisible" /> 

      <LinearLayout 
       android:id="@+id/linlaylay1" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="true" 
       android:layout_margin="0dp" 
       android:orientation="vertical" 
       android:padding="0dp" > 

       <com.google.ads.AdView 
        android:id="@+id/adViewSmall" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center_horizontal|top" 
        ads:adSize="BANNER" 
        ads:adUnitId="a123123" 
        ads:loadAdOnCreate="true" 
        ads:testDevices="TEST_EMULATOR" /> 
      </LinearLayout> 
     </RelativeLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/layoutProgress" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="top|center_horizontal" 
     android:layout_marginBottom="50dp" 
     android:layout_marginTop="5dp" 
     android:background="@drawable/progress_shape" 
     android:padding="2dp" 
     android:visibility="invisible" > 

     <TextView 
      android:id="@+id/lblLoading" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_margin="2dp" 
      android:text="@string/msg_loading" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="#000000" /> 

     <ImageButton 
      android:contentDescription="@string/dialog_cancel" 
      android:id="@+id/btnStop" 
      android:layout_width="30dp" 
      android:layout_height="30dp" 
      android:src="@drawable/stop" /> 
    </LinearLayout> 

</FrameLayout> 
+0

पीछे देखो, सामने देखो! कुछ मौके हैं जो त्रुटि देता है। लेकिन एचटीसी नए उपकरणों को जारी करता है, और समस्या इस डिवाइस में नहीं होती है। – Yaya

उत्तर

2

कई मुद्दों जब एक दूसरे के ऊपर पर हार्डवेयर त्वरित दृश्य दिखाती हैं:

यहाँ मेरी लेआउट एक्सएमएल है। मैं आपके लेआउट को फिर से काम करूंगा कि वेब दृश्य ओवरलैप न करें या दृश्य स्क्रॉल न करें, या हार्डवेयर त्वरण को अक्षम न करें।

+0

लांस, आपकी प्रतिक्रिया के लिए धन्यवाद। असल में कोई वेबव्यू ओवरलैप नहीं होता है, क्योंकि उनमें से केवल 1 दिखाई देता है, अन्य नहीं होते हैं। लोड करते समय मैं EditText क्षेत्र पर "लोडिंग" लेबल दिखाता हूं और यह सब ओवरलैपिंग है। हार्डवेयर त्वरण को अक्षम करने के बारे में आपका क्या मतलब है? –

+0

आप कोड में या पूरी तरह से अपने मैनिफेस्ट में व्यक्तिगत विचारों के लिए हार्डवेयर त्वरण को बंद कर सकते हैं, यह एंड्रॉइड की एक नई सुविधा है जहां विचार GPU बनावट में बदल जाते हैं और इस तरह से खींचे जाते हैं। वैसे, मैंने अक्सर कैमरे के पूर्वावलोकन जैसी चीज़ों को देखा है जब वे अदृश्य होते हैं तब भी चीजों में हस्तक्षेप करते हैं। यदि आप वास्तव में अपने विचारों को ढेर करने जा रहे हैं, तो आप अदृश्य के बजाय चले गए तो आप काम करने में थोड़ा बेहतर बदलाव करेंगे। इससे पहले मेरे लिए निश्चित बग है। –

1

मैंने एचटीसी फोन पर एकल वेबव्यू के साथ इस मुद्दे को देखा है। One of the comments in this bug thread वेबव्यू प्रदर्शन को अनुकूलित करने में सहायता के लिए कुछ सुझाव देता है। बग 3 डी ट्रांसफॉर्म के बारे में है लेकिन मुझे सामान्य रूप से वेबव्यू के लिए उपयोगी होने वाली टिप्पणी की तकनीकें मिली हैं।

This presentation at Google I/O 2012 सामान्य रूप से वेबव्यू के विषय पर कुछ अच्छी जानकारी भी प्रदान करता है।

दोनों सुझाव देते हैं कि गतिशील सामग्री "परत" पर रखी जाए। तत्व को यह CSS नियम बताए इसका मतलब यह है:

-webkit-transform: translate3d(0, 0, 0); 

इस नियम को लागू करके, एंड्रॉयड "ब्राउज़र बताता है पूर्व मिश्रित करने के लिए अपने स्वयं के बनावट पर परत ताकि उसे बाद के लिए (लगभग) मुक्त एनिमेटेड किया जा सकता" यह व्यवहार मुक्त नहीं है - यह अधिक स्मृति का उपभोग कर सकता है इसलिए मैं इसे समझदारी से लागू करूंगा। ऊपर लिखित प्रस्तुति एक अच्छी नौकरी बताती है कि क्यों।

मेरे मामले में, मैं इस नियम को एक डीआईवी में लागू करके "सफेद स्क्रीन" से बचने में सक्षम था जो पूरे पृष्ठ को लपेटता है। पृष्ठ कभी-कभी एक सेकंड के लिए सफेद प्रस्तुत करेगा और फिर सामग्री प्रस्तुत करेगा। मैंने इस तकनीक को लागू करने से पहले "सफेद" पृष्ठ हमेशा के लिए नहीं देखा है। मुझे आउट-ऑफ-कंट्रोल मेमोरी खपत नहीं दिखाई दे रही थी। YMMV।

मैं यह भी सुझाव दूंगा कि आप अपने लेआउट को सरल बनाने के लिए क्या कर सकते हैं। आसान करने से कहा जाता है, लेकिन कुछ अच्छे सुझाव in the docs पाया जा सकता है।

+1

मैंने कई हैक्स पढ़े हैं और सभी एचटीसी वेबव्यू मुद्दों के आसपास आने के कई तरीकों की कोशिश की है। अंत में, यह एकमात्र चीज थी जो काम करती थी। धन्यवाद! –

+0

डैनियल, यह सुनकर खुशी हुई कि यह दृष्टिकोण किसी और के लिए काम करता है। यह उन सबसे अजीब मुद्दों में से एक था जो मैंने पार किया है। –

+0

मेरे लिए काम नहीं करता है :( –

2

A known bug

आप अपने WebView पर हार्डवेयर त्वरण अक्षम लेकिन एक तरीका है कि पुराने उपकरणों को नहीं तोड़ता है में ऐसा करने के लिए सुनिश्चित हो सकते हैं:

if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.HONEYCOMB){ 
    //mWebView is some WebView 
    mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 
} 

चेतावनियां

  • वीडियो ब्राउज़र में नहीं खेलेंगे
  • स्क्रॉलिंग नहीं होगी लगभग

यह बग के अनुसार जेली बीन में तय है लेकिन मैं इसे व्यक्तिगत रूप से सत्यापित करने में सक्षम नहीं हूं।

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