`

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

阅读更多
首先我们的Listview如果是自定义的一般会有一个布局文件xxx.xml

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

然后其中的ImageButton,或Button我们为其设置
android:clickable="true"
android:focusable="false"
两个属性,就可以实现button和Listview同时点击的效果。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics