2013-10-03 54 views
0

我已经在我的application.in我的xml中实现了可扩展列表视图,我在可扩展列表view.so下面有一些按钮,当我运行我的应用程序可扩展列表视图工作正常,但我的按钮低于该列表不起作用。当我点击我的按钮时,没有发生这些按钮与扩展列表视图无关。我设置列表的所有儿童意见也可以focusable false,但我的按钮点击不工作..所有人请帮助我? 这里是我的代码,Android ExpandableListView与按钮不工作

<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> 

这里的 “postadeal_menufooter” 布局包含我的按钮,这是我下面的扩展列表视图

回答

0

你是如何设置你的XML布局?你在RelativeLayout中有他们吗?确保你的ExpandableListview不在你的按钮的“顶部”,否则你的点击将在它有机会传播到相关按钮之前被拦截。此外,如果您覆盖onTouchListeners,请选中不拦截针对按钮的点击。没有你的任何代码,很难进一步细化。希望这可以帮助。

<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" /> 
+0

嗨,驴,我张贴我的code.please检查一次,当我删除expandablelistview代码的按钮工作fine.but当我包括,那么按钮不工作 – user2239601

+0

尝试包括在你的可扩展列表xml后的页脚元件。我仍然无法看到是否将RelativeLayout用作这些元素的容器,但假设您使用的是RelativeLayout,则这些元素的“z顺序”是从上到下定义的。换句话说,您的可扩展列表linearlayout实际上是所有内容的顶部,因为它是要定义的最后一个元素。尝试将包含菜单页脚定义移动到linearlayout下方。我编辑了我的答案来反映这一点。希望这会起作用。 – donkey

0

在列表视图后添加页脚。