ScrollView cannot scroll in Slidinguppanellayout 解决办法
<?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 解决办法的更多相关文章
- Android ScrollView 嵌套 ListView、 ListView 嵌套ScrollView Scroll事件冲突解决办法
本人菜鸟一名,最近工作了,开始学习Android. 最近在做项目的时候,UX给了个design,大概就是下拉刷新的ListView中嵌套了ScrollView,而且还要在ScrollView中添加动画 ...
- Android ScrollView与ListView的冲突解决办法汇总
1. public void setListViewHeight(){ ListAdapter listadapter = lv.getAdapter(); if (listadapter == n ...
- 加入ScrollView后OnGestureListener无效的解决办法
android中,ViewFlipper+OnGestureListener可以实现左右滑动效果. 但是在ViewFlipper加上了ScrollView就悲剧了,左右滑动事件无效了…… 这里其实只需 ...
- 一个页面tab标签切换,都有scroll事件的解决办法
当前页有多个tab,如果都有scroll事件, 先解绑$(window).off('scroll') 再执行scroll就不可以了,多个标签就不会互相干扰: 给你们个例子: //标签切换 $(' ...
- ios overflow:scroll不顺畅解决办法
是要在其样式里面添加这段代码就行 -webkit-overflow-scrolling: touch;
- Android ScrollView中的组件设置android:layout_height="fill_parent"不起作用的解决办法
例子,在ScrollView下加入的组件,无论如何也不能自动扩展到屏幕高度. 布局文件. [html] <?xml version="1.0" encoding=" ...
- Android开发:ScrollView嵌套GridView的解决办法
Android开发:ScrollView嵌套GridView的解决办法 前些日子在开发中用到了需要ScrollView嵌套GridView的情况,由于这两款控件都自带滚动条,当他们碰到一起的时候便 ...
- ScrollView嵌套ListView显示不完全、嵌套TextView不能滚动解决办法
目录: 一.情景说明 二.最初做法 三.解决办法 一.情景说明 1.情景 最近项目刚好有一个需求,需要在一个界面中用ScrollView嵌套一个滚动的TextView和一个listView ...
- vue监听scroll使用报错的解决办法
错误说明:在切换路由以后,依旧在其他页面触发了scroll有关的函数, 错误原因:在spa项目中,window对象是不变的,所以每次使用后需要销毁. 解决办法:vue的生命周期destroyed中销毁 ...
随机推荐
- 13 nginx gzip压缩提升网站速度
一:nginx gzip压缩提升网站速度 我们观察news.163.com的头信息 请求: Accept-Encoding:gzip,deflate,sdch 响应: Content-Encoding ...
- android 关于ScrollView 的博客做记录学习
1.Android ScrollView向上滑动控件顶部悬浮效果实现 2.[android]仿知乎ScrollView滚动改变标题栏透明度 3.github开源Android组件资源整理(五)Scro ...
- git 工具 - 子模块(submodule)
From: https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E5%AD%90%E6%A8%A1%E5%9D%97 子模块 有种情况我们经常 ...
- CSDN专訪:大数据时代下的商业存储
原文地址:http://www.csdn.net/article/2014-06-03/2820044-cloud-emc-hadoop 摘要:EMC公司作为全球信息存储及管理产品方面的率先公司,不久 ...
- hadoop基础----hadoop理论(四)-----hadoop分布式并行计算模型MapReduce具体解释
我们在前一章已经学习了HDFS: hadoop基础----hadoop理论(三)-----hadoop分布式文件系统HDFS详细解释 我们已经知道Hadoop=HDFS(文件系统,数据存储技术相关)+ ...
- 短信计时器Utils
package com.lvshandian.partylive.utils; import android.content.Context;import android.os.CountDownTi ...
- Java 学习 day01
1. 基本常识 2. Java的跨平台性 3. Java环境搭建(安装) 4. Java环境搭建(环境变量配置) 5. Java环境搭建(环境变量配置技巧) 6. Java环境搭建(环境变量临时配置方 ...
- 【BZOJ4619/3709】[Wf2016]Swap Space/[PA2014]Bohater 贪心
[BZOJ4619][Wf2016]Swap Space Description 你有许多电脑,它们的硬盘用不同的文件系统储存数据.你想要通过格式化来统一文件系统.格式化硬盘可能使它的容量发生变化.为 ...
- 九度OJ 1178:复数集合 (插入排序)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:8393 解决:1551 题目描述: 一个复数(x+iy)集合,两种操作作用在该集合上: 1.Pop 表示读出集合中复数模值最大的那个复数,如 ...
- vc2013使用经验
1 find all reference功能需要visual assist的帮助 vs2013自己的查找不行,所以可以安装visual assist X,这样的话,就可以支持快速准确的referenc ...