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. MySQL技术内幕InnoDB存储引擎(表&索引算法和锁)

    表 4.1.innodb存储引擎表类型 innodb表类似oracle的IOT表(索引聚集表-indexorganized table),在innodb表中每张表都会有一个主键,如果在创建表时没有显示 ...

  2. SQLite 数据库安装与创建数据库

    嵌入式关系数据库 Ubuntu $ sudo apt-get install sqlite3 sqlite3-dev CentOS, or Fedora $ yum install SQLite3 s ...

  3. 【LeetCode从零单排】No.135Candy(双向动态规划)

    1.题目 There are N children standing in a line. Each child is assigned a rating value. You are giving ...

  4. 阿里云Opensearch数据类型

    阿里云主要支持以下数据类型,详情参考:https://help.aliyun.com/document_detail/29121.html 类型 说明 INT int64整型 INT_ARRAY in ...

  5. python 基础 7.8 json--下

      一. 文件和json 之间的转换 1. json.dump()   #/usr/bin/python #coding=utf-8 #@Time   :2017/11/13 0:12 #@Authe ...

  6. HttpPost (URLConnection)传参数中文乱码

    client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 1000000); client.getParams( ...

  7. new() 和 make() 的区别

    https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/07.2.md

  8. dom 显示 与否 的对 ecmascript 变量的 监听

    dom 显示 与否  的对 ecmascript   变量的 监听

  9. Why Use C++/CLI?

    来源:http://www.asawicki.info/Download/Productions/Publications/CPP_CLI_tutorial.pdf Why Use C++/CLI? ...

  10. A. Drazil and Date

    这是codeforces#292 div2 的一道题,因为本人比较水,目前只能做div2了.问题简化版就是: 从 (0,0) 走到 (a, b) ,s 步能不能走完.每次能向上下左右走,且只能走一步. ...