onClick列表项目阻止onItemClick在android中

时间:2014-06-05 09:49:58

标签: android android-listview android-custom-view

我创建了自定义列表视图,其中有一个按钮,我的问题是在列表项目中添加按钮后,列表视图的点击已停止工作。有没有办法让两个听众都能工作?

1 个答案:

答案 0 :(得分:4)

将其设置为ListItem root Layout

android:descendantFocusability="blocksDescendants"

并设置

    android:focusable="true"
    android:focusableInTouchMode="true"

Buttons。这似乎适用于我的情况。