方法就是修改item布局的xml文件:

根布局里加上:

android:descendantFocusability="blocksDescendants"

然后在按钮布局里加上:

 android:focusable="false"

item和按钮都 可以点了,就OK了



下面是布局示例:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"     android:descendantFocusability="blocksDescendants"



 <Button            android:id="@+id/worklog_update"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="修改"             android:focusable="false"            />        <Button            android:id="@+id/worklog_del"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="删除"             android:focusable="false"            />


更多相关文章

  1. Android使用SQLite数据库的示例
  2. android中动态布局(动态加入TextView和ListView)
  3. Android RadioButton 单选按钮
  4. 如何在Android中在fragment中实现点击按钮事件?
  5. Android中对Group的各种操作示例代码
  6. Android 之 添加按钮添加声音
  7. 【Android】抽屉控件 SlidingDrawer 的简单示例

随机推荐

  1. msm8996 qcom 平台,lk中通过串口进入fastb
  2. 自己写的一个android小应用 手电筒
  3. Android-BaseAdapter-study
  4. Android 4.0 Launcher2源码分析——主布
  5. android4.4 Launcher主菜单界面同样采用
  6. Android-给图片添加暗影
  7. Android中SQLite应用详解(很详细)
  8. Android(安卓)-- The Manifest File
  9. android代码库之执行Shell命令或者脚本
  10. Android中Activity组件详解