RecycleView去除自动回滚至顶部
2017-11-20 11:35
141 查看
使用 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 会覆盖子类控件而直接获得焦点通常我们用到的是第三种,即在Item布局的根布局加上android:descendantFocusability=”blocksDescendants”的属性就解决啦
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 会覆盖子类控件而直接获得焦点通常我们用到的是第三种,即在Item布局的根布局加上android:descendantFocusability=”blocksDescendants”的属性就解决啦
相关文章推荐
- 细节问题之ScrollView自动回滚到顶部
- 滚动条事件,当页面滚动到距顶部一定高度时某DIV自动隐藏和显示
- TransactionScope只要一个操作失败,它会自动回滚,Complete表示事务完成
- 如何实现页面顶部flash播放完自动关闭
- TransactionScope只要一个操作失败,它会自动回滚,Complete表示事务完成
- ios中关于UIPageViewController边缘自动翻页去除的问题
- 去除JSP页面自动生成的空行
- winform中去除DataGridView自动生成的多余列
- 使用spring声明式事务,spring使用AOP来支持声明式事务,会根据事务属性,自动在方法调用之前决定是否开启一个事务,并在方法执行之后决定事务提交或回滚事务。
- chrome浏览器当表单自动填充时如何去除浏览器自动添加的默认样式
- eclipse如何设置自动去除多余引入的类?
- 如何去除Chrome浏览器表单文本框Input自动填充黄色背景色样式?
- iOS AutoLayout自动布局中级开发教程(7)-底部顶部baseLine基线对齐
- Android listview增加条目时自动回滚到最后一行
- android TextView去除顶部和底部留白
- chrome浏览器当表单自动填充时,怎么去除浏览器自动添加的默认样式。
- 去除partner页面消息 自动添加关注者的功能
- jQuery实现拉动页面固定顶部显示且自动消失(火狐)
- 避免刷新页面,自动跳回到页面顶部的办法
- 自动回滚的listview