三种方法都可以实现:需要在listview显示内容的布局文件里进行修改才可以起到作用
1.在linearLayout中添加android:descendantFocusability="blocksDescendants"

2.在linearLayout中添加android:descendantFocusability="blocksDescendants" 同时也在button中添加android:focusable="false“都可以实现的


<?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:descendantFocusability="blocksDescendants">    <CheckBox  android:id="@+id/checkbox1"  android:layout_width="wrap_content"  android:layout_height="wrap_content" android:focusable="false"/>      <TextView  android:id="@+id/text1"  android:layout_width="wrap_content"  android:layout_height="wrap_content"  android:textSize="16dp"/>  </LinearLayout>




更多相关文章

  1. android 界面布局-各个布局的属性介绍
  2. android view的几种布局方式
  3. Android基础知识之Manifest文件的组织结构
  4. Android 五种布局简单介绍
  5. android中一些配置文件的参数的意义
  6. Android ImageView控件的setMaxWidth、setMaxHeight不起作用
  7. Android实现文件上传功能
  8. android Gradle打包修改生成的apk文件名称
  9. Android中遍历文件夹、比较文件类型测试

随机推荐

  1. Handler知识点总结
  2. 画一个可以动的Android 小机器人
  3. Android 手机卡了怎么办
  4. Android有用的程序片段
  5. 分享一个有关Android从小白到资深工程师
  6. android 仓库下载分析
  7. 为 Android 添加 Java 层服务
  8. 两张图让你完全了解IDEA和Android Studio
  9. SDL2库(4)-Android(安卓)端源码简要分析(A
  10. Android(安卓)studio 软件安装过程中遇到