Sarath Kumar
Sarath Kumar

Reputation: 2010

Android Child Views inside FrameLayout are Clickable ,How to disable the click of frameLayout child?

when i click the textview its opens the list item popup activity but i set textview android:clickable="false" is not working so how to i disable the click of FrameLayout Child views

<FrameLayout        
    android:layout_width="match_parent"
    android:layout_height="wrap_content"            
    android:orientation="vertical">    

    <ListView        
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="@null" 
        android:clickable="true"
        android:fadingEdge="none"/>   

    <LinearLayout        
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:orientation="vertical">

        <TextView
            android:id="@+id/textview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="false"
            android:text="Text"/>

    </LinearLayout> 

</FrameLayout>

Upvotes: 1

Views: 1470

Answers (1)

SilentKiller
SilentKiller

Reputation: 6942

As you want TextView to scroll with ListView as last time the best way is to add that View as footer of the ListView

TextView mFooterTextView = new TextView(mContext);
listView.addFooterView(footerView);

and your XML will be

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <ListView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="@null"
        android:clickable="true"
        android:fadingEdge="none"/>

</FrameLayout>

Upvotes: 1

Related Questions