2013-04-18 5 views
5

मेरे पास रैखिक लेआउट है जिसमें केवल वेब व्यू है। मैं क्या करना चाहता हूं वेबव्यू में क्लिक को अक्षम करना है, इसका मतलब है कि मैं चाहता हूं कि ईवेंट रिलेवेटिवआउट bg_stepsContainer से जुड़ा हुआ हो। मैंने एंड्रॉइड का उपयोग किया है: क्लिक करने योग्य = "झूठा" यहां कोडवेबव्यू के क्लिकिंग को अक्षम कैसे करें?

<RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:minHeight="30dp" 
        android:layout_marginLeft="5dp" 
        android:layout_marginRight="5dp" 
        android:layout_marginTop="5dp" 
        android:layout_marginBottom="5dp" 
        android:id="@+id/bg_stepsContainer" 
        > 

       <LinearLayout 
        android:id="@+id/stepslcontainer" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentTop="true" 

        android:clickable="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" > 

        <WebView 
         android:id="@+id/bg_stepsToReproduce" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:clickable="false" 
         android:focusable="false" 
         android:focusableInTouchMode="false" 

         android:textColor="@color/solid_black" /> 

        </LinearLayout> 
        <ImageView 
         android:id="@+id/stepsArrow" 
         android:layout_width="10dp" 
         android:layout_height="10dp" 
         android:layout_alignParentRight="true" 
         android:clickable="false" 
         android:layout_marginRight="10dp" 
         android:layout_marginLeft="10dp" 
         android:layout_centerVertical="true" 
         android:src="@drawable/ic_right_arrow" /> 

</RelativeLayout> 

किसी भी सुझाव की सराहना की जाती है!

+0

शायद यह आपकी मदद करता है http://stackoverflow.com/questions/4415528/how-to-pass-the-onclick-event-to-its-parent-on-android –

+0

http://stackoverflow.com/questions/3853794/अक्षम-वेबव्यू-टच-इवेंट-इन-एंड्रॉइड यह मददगार होगा –

उत्तर

20
mWebView.setOnTouchListener(new View.OnTouchListener() { 
    @Override 
    public boolean onTouch(View v, MotionEvent event) { 
     return true; 
    } 
}); 

एंड्रॉइड का उपयोग करके: क्लिक करने योग्य = "झूठा" स्पर्श घटनाओं को अक्षम नहीं करता है।

+0

फिर टच इवेंट्स को कैसे सक्षम करें कृपया मेरी मदद करें .. –

+0

@GowthamanM बस वेबव्यू से 'ऑन टचलिस्टर' को हटा दें। – ubuntudroid

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