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. 认识 service worker

    离线缓存可以提升用户体验,可以节省网络资源,但是,浏览器对资源缓存和自定义网络请求的控制一直不够完善,service worker 的出现就是为了解决这些问题 它可以解决目前离线应用的问题,同时也可以 ...

  2. fzu 2039 Pets (简单二分图 + (最大流 || 二分图))

    Are you interested in pets? There is a very famous pets shop in the center of the ACM city. There ar ...

  3. POJ 3895 Cycles of Lanes (dfs)

    Description Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of t ...

  4. 使用struts2中默认的拦截器以及自定义拦截器

    转自:http://blog.sina.com.cn/s/blog_82f01d350101echs.html 如何使用struts2拦截器,或者自定义拦截器.特别注意,在使用拦截器的时候,在Acti ...

  5. 如果数据需要被多个应用程序消费的话,推荐使用 Kafka,如果数据只是面向 Hadoop 的,可以使用 Flume

    https://www.ibm.com/developerworks/cn/opensource/os-cn-kafka/index.html Kafka 与 Flume 很多功能确实是重复的.以下是 ...

  6. ABAP div / mod的用法

    1.divdiv是用于取两数相除的商的,c = a div b,得到的c的值就是a除b的商.2.// 是用于取两数相除的结果的.c = a / b,如果c是i数据类型的,这个语法会进行四舍五入的.3. ...

  7. /etc/init.d/nginx

    #! /bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="nginx daemon ...

  8. 《高性能Javascript》 Summary(三)

    第八章.编程实践 Programming Practices 经验: 避免使用 eval_r()和Function构造器避免二次评估.此外,给setTimeout()和setInterval()函数传 ...

  9. 《程序员代码面试指南》第八章 数组和矩阵问题 在数组中找到出现次数大于N/K 的数

    题目 在数组中找到出现次数大于N/K 的数 java代码 package com.lizhouwei.chapter8; import java.util.ArrayList; import java ...

  10. rocketmq安装

    1 安装Rocketmq https://my.oschina.net/daijunjian/blog/732560 2 可视化管理控台 http://blog.csdn.net/jayjjb/art ...