当前位置:网站首页>Webview,ScrollView滑动冲突咋整
Webview,ScrollView滑动冲突咋整
2022-06-30 11:16:00 【xiyangyang8110】
public class MyScrollView extends ScrollView {
private GestureDetector mGestureDetector;
View.OnTouchListener mGestureListener;
public MyScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
mGestureDetector = new GestureDetector(context, new YScrollDetector());
setFadingEdgeLength(0);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return super.onInterceptTouchEvent(ev) && mGestureDetector.onTouchEvent(ev);
}
// Return false if we're scrolling in the x direction
class YScrollDetector extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (Math.abs(distanceY) > Math.abs(distanceX)) {
return true;
}
return false;
}
}
}
边栏推荐
- 阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
- 19年来最艰难的618,徐雷表达三个谢意
- 数学(快速幂)
- 林克庆到番禺区调研“发展要安全”工作 以“时时放心不下”责任感抓好安全发展各项工作
- Mathematics (fast power)
- 【小程序实战系列】小程序框架 页面注册 生命周期 介绍
- The latest collection of arouter problems
- Understanding society at the age of 14 - reading notes on "happiness at work"
- ESP32-C3入门教程 IoT篇⑤——阿里云 物联网平台 EspAliYun RGB LED 实战之批量生产的解决方案
- Filter error in dplyr: can't transform a data frame with duplicate names
猜你喜欢

国内首批!阿里云云原生数据湖产品通过信通院评测认证

Summer vacation study record

R语言去重操作unique duplicate filter

Multiparty Cardinality Testing for Threshold Private Set-2021:解读

科普达人丨漫画图解什么是eRDMA?

Filter error in dplyr: can't transform a data frame with duplicate names

记一次ViewPager + RecyclerView的内存泄漏
![[IC5000 tutorial] - 01- use daqdea graphical debug to debug C code](/img/54/037b62ff9682ae9fdf861263211043.png)
[IC5000 tutorial] - 01- use daqdea graphical debug to debug C code

对象映射 - Mapping.Mapster

阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
随机推荐
【小程序实战系列】小程序框架 页面注册 生命周期 介绍
ESP32-C3入门教程 IoT篇⑤——阿里云 物联网平台 EspAliYun RGB LED 实战之批量生产的解决方案
【无标题】
Introduction to China Mobile oneos development board
It's time for the kotlin coroutine to schedule thread switching to solve the mystery
达梦数据冲刺科创板,或成A股市场“国产数据库第一股”
MCU firmware packaging Script Software
考研这些“不靠谱”的经验有多害人?
PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏
LiveData源码赏析三 —— 常见问题
[untitled]
科普達人丨漫畫圖解什麼是eRDMA?
Xu Lei expressed three thanks for the most difficult 618 in 19 years
深入解析 Apache BookKeeper 系列:第四篇—背压
Database cascading operation
Flutter start from scratch 008 form
优惠券种类那么多,先区分清楚再薅羊毛!
Uncover the whole link communication process of customer service im
Lucene全文检索工具包学习笔记总结
Oracle netsuite helps TCM bio understand data changes and make business development more flexible