xml源码如下
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" > <com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:dragView="@+id/name"
sothree:panelHeight="40dp"
sothree:paralaxOffset="100dp"
sothree:shadowHeight="4dp" > <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical" > <RelativeLayout
android:id="@+id/rel_top_layout"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@color/t_blue" > <TextView
android:id="@+id/title_text_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="统计图"
android:textColor="@color/white"
android:textSize="22sp" /> <Button
android:id="@+id/btn_back"
android:layout_width="50dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/back_btn_selector" />
</RelativeLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/border" > <LinearLayout
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout> <RadioGroup
android:id="@+id/radiogroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" > <RadioButton
android:id="@+id/radio_histogram"
style="@style/param_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:layout_weight="1"
android:button="@drawable/radio_btn_selector"
android:onClick="changeGraph"
android:text="柱状图" /> <RadioButton
android:id="@+id/radio_line_graph"
style="@style/param_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:layout_weight="1"
android:button="@drawable/radio_btn_selector"
android:onClick="changeGraph"
android:text="折线图" />
</RadioGroup>
</LinearLayout> <ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" > <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="false"
android:orientation="vertical" > <LinearLayout
android:id="@+id/drag"
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="vertical" > <ImageView
android:id="@+id/up"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1594df"
android:src="@drawable/icon_up"
android:visibility="visible" /> <ImageView
android:id="@+id/down"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1594df"
android:src="@drawable/icon_down"
android:visibility="gone" />
</LinearLayout> <LinearLayout
android:id="@+id/table_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
</ScrollView>
</com.sothree.slidinguppanel.SlidingUpPanelLayout> </RelativeLayout>

在Activity中

        slidingUpPanel.setDragView(findViewById(R.id.drag));
// can't add this line
// slidingUpPanel.setEnableDragViewTouchEvents(true);

在com.sothree.slidinguppanel.SlidingUpPanelLayout中的onInterceptTouchEvent 处理 case MotionEvent.ACTION_DOWN:

    private boolean isDragViewHit(int x, int y) {
if (isExpanded()) {
// don't intercept touch if panel expanded
return false;
} else {
// original implementation - only allow dragging on mDragView
View v = mDragView != null ? mDragView : mSlideableView;
if (v == null)
return false;
int[] viewLocation = new int[2];
v.getLocationOnScreen(viewLocation);
int[] parentLocation = new int[2];
this.getLocationOnScreen(parentLocation);
int screenX = parentLocation[0] + x;
int screenY = parentLocation[1] + y;
return screenX >= viewLocation[0] && screenX < viewLocation[0] + v.getWidth()
&& screenY >= viewLocation[1] && screenY < viewLocation[1] + v.getHeight();
}
}

ScrollView cannot scroll in Slidinguppanellayout 解决办法的更多相关文章

  1. Android ScrollView 嵌套 ListView、 ListView 嵌套ScrollView Scroll事件冲突解决办法

    本人菜鸟一名,最近工作了,开始学习Android. 最近在做项目的时候,UX给了个design,大概就是下拉刷新的ListView中嵌套了ScrollView,而且还要在ScrollView中添加动画 ...

  2. Android ScrollView与ListView的冲突解决办法汇总

    1. public  void setListViewHeight(){ ListAdapter listadapter = lv.getAdapter(); if (listadapter == n ...

  3. 加入ScrollView后OnGestureListener无效的解决办法

    android中,ViewFlipper+OnGestureListener可以实现左右滑动效果. 但是在ViewFlipper加上了ScrollView就悲剧了,左右滑动事件无效了…… 这里其实只需 ...

  4. 一个页面tab标签切换,都有scroll事件的解决办法

    当前页有多个tab,如果都有scroll事件, 先解绑$(window).off('scroll') 再执行scroll就不可以了,多个标签就不会互相干扰: 给你们个例子: //标签切换    $(' ...

  5. ios overflow:scroll不顺畅解决办法

    是要在其样式里面添加这段代码就行  -webkit-overflow-scrolling: touch;

  6. Android ScrollView中的组件设置android:layout_height="fill_parent"不起作用的解决办法

    例子,在ScrollView下加入的组件,无论如何也不能自动扩展到屏幕高度. 布局文件. [html] <?xml version="1.0" encoding=" ...

  7. Android开发:ScrollView嵌套GridView的解决办法

    Android开发:ScrollView嵌套GridView的解决办法   前些日子在开发中用到了需要ScrollView嵌套GridView的情况,由于这两款控件都自带滚动条,当他们碰到一起的时候便 ...

  8. ScrollView嵌套ListView显示不完全、嵌套TextView不能滚动解决办法

    目录: 一.情景说明 二.最初做法 三.解决办法 一.情景说明 1.情景       最近项目刚好有一个需求,需要在一个界面中用ScrollView嵌套一个滚动的TextView和一个listView ...

  9. vue监听scroll使用报错的解决办法

    错误说明:在切换路由以后,依旧在其他页面触发了scroll有关的函数, 错误原因:在spa项目中,window对象是不变的,所以每次使用后需要销毁. 解决办法:vue的生命周期destroyed中销毁 ...

随机推荐

  1. PythonCookBook笔记——函数

    函数 可接受任意数量参数的函数 接受任意数量的位置参数,使用*参数. 接受任意数量的关键字参数,使用**参数. 只接受关键字参数的函数 强制关键字参数放在某个参数后或直接单个之后. 给函数参数增加元信 ...

  2. 大白第一章第四节dp例题

    入口 UVALive - 3882 #include<cstdio> using namespace std; ; int n,m,k,f[N]; int main(){ //f[i]表示 ...

  3. 【BZOJ4166】月宫的符卡序列 Manacher+hash

    [BZOJ4166]月宫的符卡序列 题解:题倒不难,就是有点恶心. 首先学习回文串的时候一定学到了这样一个结论:一个长度为n的串的本质不同的回文子串数量不超过n个. 那么我们就可以试图将所有回文串的价 ...

  4. RTSP转RTMP-HLS网页无插件视频直播-EasyNVR功能介绍-音频开启

    EasyNVR简介 EasyNVR能够通过简单的摄像机通道配置.存储配置.云平台对接配置.CDN配置等,将统监控行业里面的高清网络摄像机IP Camera.NVR.移动拍摄设备接入到EasyNVR,E ...

  5. 云服务器 ECS Linux CentOS 修改内核引导顺序

    由于 CentOS 7 使用 grub2 作为引导程序,所以和 CentOS 6 有所不同,并不是修改 /etc/grub.conf 来修改启动项,需要如下操作: 1. 查看系统内部有多少个内核: c ...

  6. Netty聊天室-源码

    目录 Netty聊天室 源码工程 写在前面 [百万级流量 聊天室实战]: [分布式 聊天室] [Spring +Netty]: [Netty 原理] 死磕 系列 [提升篇]: [内力大增篇]: 疯狂创 ...

  7. java中final与static的使用场景

    final Java关键词final有“无法改变”的含义,主要用于修饰非抽象类.方法或者变量.使用时注意: final类不能被继承,没有子类,final类中的方法默认是final的. final方法不 ...

  8. 远程服务器上的weblogic项目管理(三)常用指令及常见错误

    weblogic的管理流程已在前两节整理完毕,接下来汇总一下linux环境下的weblogic管理常用指令及常见错误: 常用指令: ./startWebLogic.sh 启动weblogic ./st ...

  9. hdoj 1116 Play on Words 【并查集】+【欧拉路】

    Play on Words Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  10. sed 简单用法

    sed的一个简单用法: eg:在某一个文件中的一个aaa字段前后添加某些字段. 在aaa前面添加字段:sed -ne 's/aaa/&HELLO/p' test 输出结果:aaaHELLO 在 ...