android:descendantFocusability用法简析
来源:互联网 发布:孕五个月胎动知男女 编辑:程序博客网 时间:2024/06/03 16:55
android:descendantFocusability用法
分类:
版权声明:本文为博主原创文章,未经博主允许不得转载。
http://blog.csdn.net/telencool/article/details/17511331
项目中的listview不仅仅是简单的文字,常常需要自己定义listview,自己的Adapter去继承BaseAdapter,在adapter中按照需求进行编写,诸如ImageButton,Button,CheckBox等子控件(也可以说是Button或者Checkable的子类控件)此时这些子控件会将焦点获取到,所以常常当点击item时变化的是子控件,item本身的点击没有响应。
android:descendantFocusability
Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus.
Must be one of the following constant values.
该属性是当一个为view获取焦点时,定义viewGroup和其子控件两者之间的关系。
属性的值有三种:
beforeDescendants:viewgroup会优先其子类控件而获取到焦点
afterDescendants:viewgroup只有当其子类控件不需要获取焦点时才获取焦点
blocksDescendants:viewgroup会覆盖子类控件而直接获得焦点
至于用法么,就是在item 里的RelativeLayout 加入android:descendantFocusability="beforeDescendants" 0 0
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- android:descendantFocusability用法简析
- Java中使用Jedis操作Redis—Redis快速入门
- DV .net mvc 部分开发记录1
- 198. House Robber
- 利用反射获取实体所有属性和方法
- 一些第三方插件
- android:descendantFocusability用法简析
- <mvc:default-servlet-handler/>标签作用
- SPI和API
- ASP.NET Core MVC/WebAPi 模型绑定探索
- C# MSIL 和 闭包
- ZIPKIN 学习
- 详解ORACLE数据库的分区表
- android UiAutomator 借助数据库查询来验证结果并记录在log中
- 第七届蓝桥杯四平方和