listview中嵌套listview,子listview无法滚动
来源:互联网 发布:自学外语的网站知乎 编辑:程序博客网 时间:2024/04/29 15:37
自定义vlistview,重写
onInterceptTouchEvent()方法public class InnerListView extends ListView { public InnerListView(Context context) { super(context); } public InnerListView(Context context, AttributeSet attrs) { super(context, attrs); } public InnerListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { switch (ev.getAction()) { // 当手指触摸listview时,让父控件交出ontouch权限,不能滚动 case MotionEvent.ACTION_DOWN: setParentScrollAble(false); case MotionEvent.ACTION_MOVE: break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: // 当手指松开时,让父控件重新获取onTouch权限 setParentScrollAble(true); break; } return super.onInterceptTouchEvent(ev); } // 设置父控件是否可以获取到触摸处理权限 private void setParentScrollAble(boolean flag) { getParent().requestDisallowInterceptTouchEvent(!flag); }}
0 0
- listview中嵌套listview,子listview无法滚动
- listView中嵌套viewpager随着listview滚动
- listview中嵌套子listview,解决子listview点击问题
- ListView中嵌套ListView
- ListView中嵌套listView
- ListView中嵌套ListView
- ListView中嵌套ListView
- ListView中嵌套ListView
- ListView中嵌套ListView
- Android经常遇到Scrollview嵌套Listview造成listview无法滚动
- android开发中ScrollView中嵌套ListView造成ListView无法独立滚动的解决方法
- scrollView中嵌套ListView,ListView不能滚动的问题
- android listview嵌套在滚动条中
- 横向ListView中嵌套ListView
- Android 中ListView 嵌套 ListView
- Android listview 中嵌套 listview
- Android ListView嵌套ListView、滚动刷新数据
- scrollview嵌套listview,listview不滚动问题
- RUN LOOP 是个什么东西?
- WEB架构师成长之路
- 安卓binder机制executeCommand(...)方法sp<BBinder> b((BBinder*)tr.cookie);分析
- Java中的参数传递方式
- 合唱团——2016网易内推编程题
- listview中嵌套listview,子listview无法滚动
- NSIS 关于 uninst.exe 的签名问题
- Android折叠面板
- 关于高精度运算
- nmap 源码编译
- Centos 安装Sublime text 3
- 青蛙的约会
- 51Nod-1475-建设国家
- mysql笔记九——Dbutils的使用(增删改查,事务)