listview和其中的item中的view焦点冲突解决方案
2015-11-21 10:23
381 查看
在xml文件中配置 descendantFocusability
descendantFocusability API描述如下:
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会覆盖子类控件而直接获得焦点
根据需求做出选择即可
相关文章推荐
- 华为OJ中级-计算日期到天数转换
- 各种坑的笔记
- win10 1511(win10 TH2)如何调整开始屏幕磁贴大小?
- 单片机 MSP430 模拟IIC编程(2)
- RDBMS DBMS MS DB
- 《浪潮之巅》随想
- kaptcha验证码使用
- OpenGL教程翻译 第二十五课 天空盒
- flask-学习目的与开发环境搭建
- Codeforces Round #332 (Div. 2)B. Spongebob and Joke(模拟)
- 【伸展树】[CQBZOJ2803]普通平衡树splay模板
- 為你的文件夾添加“使用CMD命令打開”菜單
- 服务器迁移到 Windows Servec 2008 R2 64 bit 和IIS 7问题记录
- ios审核加急服务
- Qt制作Aero特效窗口
- LeetCode -- Min Stack
- javascript正则表达式:非捕获分组的一个使用例子
- 23.navigationBar导航条
- iOS开发中CALayer使用的基本教程
- python学习笔记-Day04-第四部分(装饰器)