listview嵌套listview,底部的listview不能滑动问题
来源:互联网 发布:淘宝小号安全交易网 编辑:程序博客网 时间:2024/05/18 00:17
自定义一个listview
public class MyListView extends ListView {
public MyListView(Context context) {
super(context);
}
public MyListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyListView(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);
}
}
然后在xml中使用
<so.king.MyListView
android:id="@+id/li_lv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="@null"
android:scrollingCache="false" />
引用 http://www.th7.cn/Program/Android/201408/262686.shtml
- listview嵌套listview,底部的listview不能滑动问题
- 解决drawerlayout嵌套listview 导致listview不能滑动的问题
- 解决!Gallery中嵌套ListView,Gallery不能滑动的问题
- 解决scrollView嵌套viewpager+listview,scrollview不能滑动的问题
- ListView嵌套ListView的问题
- ScrollView嵌套listview滑动位置底部bug
- ScrollView 嵌套listview自动滑动到底部的解决办法
- SwipeRefreshLayout 嵌套 ListView 滑动问题
- scrollView中嵌套ListView,ListView不能滚动的问题
- listview嵌套listview视图显示不全以及子listview不能滑动的处理
- ListView嵌套listView问题
- listview嵌套listview问题
- srcollview 嵌套ListView ListView 再嵌套gridview 焦点滑动问题
- ListView 嵌套 GridView 或者是listview 嵌套listView 的问题
- listview嵌套listview ScrollView嵌套listview 的冲突问题
- 解决ListView嵌套ListView遇到的问题
- listview 嵌套listview的显示问题
- listview 嵌套listview的显示问题
- java类中的误区
- 判断索引是否需要重建
- android surfaceView双缓冲问题的脏矩形刷新
- mysql命令大全
- jQuery Mobile弹窗效果
- listview嵌套listview,底部的listview不能滑动问题
- IDEA 快捷键
- 孙鑫对话框二中为什么要对按钮控件新建一个类(小结,5.2给出了结论)
- 优化数据页面(10)——标题行居中对齐
- hadoop压缩与解压
- Android中的Handler机制
- 虚拟视点图像生成006
- java 中instanceof 的用法
- 千里马若有人赏识--不论对错,不为输赢,我就是认真。