当前位置: 代码迷 >> Android >> android Listview中button 跟Listview可同时点击的方法
  详细解决方案

android Listview中button 跟Listview可同时点击的方法

热度:24   发布时间:2016-05-01 17:17:55.0
android Listview中button 和Listview可同时点击的方法
首先我们的Listview如果是自定义的一般会有一个布局文件xxx.xml

在这个xml中第一个元素一般是LinearLayout或RelativeLayout
中加上
android:descendantFocusability="blocksDescendants"

然后其中的ImageButton,或Button我们为其设置
android:clickable="true"
android:focusable="false"
两个属性,就可以实现button和Listview同时点击的效果。
  相关解决方案