简体   繁体   中英

Android ExpandableListView with buttons not working

I have implemented expandable list view in my application.in my xml,i have some buttons in below of the expandable list view.so when i run my application expandable list view working fine,but my buttons below that list are not working.nothing happening when i click on my buttons,those buttons are not related to expand list view. i set all child views of list to focusable false also.but my button clicks not working..any one help me please? here is my code,

 <include android:id="@+id/headerID" layout="@layout/ds_header" /> <include layout="@layout/postadeal_menufooter" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/headerID" > <ExpandableListView android:id="@+id/postadeal_ExpandListID" android:layout_width="match_parent" android:layout_height="500dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" > </ExpandableListView> </LinearLayout> 

Here "postadeal_menufooter" layout contains my buttons,which is below my expandable list view

How are you setting up your xml layout? Do you have them in a RelativeLayout? Make sure that your ExpandableListview is not "on top" of your buttons, otherwise your clicks would be intercepted before it has the chance to propagate to the associated buttons. Also, if you overrode onTouchListeners, check to not intercept clicks that are meant for the buttons. Without any code from you it's rather hard to go further into specifics. Hope this helps.

<include
    android:id="@+id/headerID"
    layout="@layout/ds_header" />

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/headerID" >

    <ExpandableListView
        android:id="@+id/postadeal_ExpandListID"
        android:layout_width="match_parent"
        android:layout_height="500dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true" >
    </ExpandableListView>
</LinearLayout>

<include layout="@layout/postadeal_menufooter" />

在listview之后添加页脚。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM