当前位置:网站首页>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;
}
}
}
边栏推荐
- [leetcode 16] sum of three numbers
- 学习redis实现分布式锁—–自己的一个理解
- Wechat Emoji is written into the judgment, and every Emoji you send may become evidence in court
- [applet practice series] Introduction to the registration life cycle of the applet framework page
- 一个悄然崛起的国产软件,低调又强大!
- Go语言学习之Switch语句的使用
- 据说用了这个,老板连夜把测试开了
- Set up your own website (13)
- EMC surge
- 100 important knowledge points that SQL must master: creating and manipulating tables
猜你喜欢

Xu Lei expressed three thanks for the most difficult 618 in 19 years

Go language defer

启明星辰集团运维安全网关(堡垒机)再次夺得榜首!

CVPR 2022 | greatly reduce the manual annotation required for zero sample learning. Mapu and Beiyou proposed category semantic embedding rich in visual information

dplyr 中的filter报错:Can‘t transform a data frame with duplicate names

R language view version R package view version

Le talent scientifique 丨 dessins animés qu'est - ce qu'erdma?

PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏

Kotlin 协程调度切换线程是时候解开谜团了

promise async和await的方法与使用
随机推荐
Kotlin 协程调度切换线程是时候解开谜团了
压缩状态DP位运算
ESP32-C3入门教程 基础篇⑫——量产烧写设备配置和序列号, NVS partition分区确认, NVS 分区生成程序, csv转bin
datax json说明
LiveData源码赏析三 —— 常见问题
Qt嵌入子Qt程序窗口到当前程序
10天学会flutter DAY10 flutter 玩转 动画与打包
一个人就是一本书
PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏
R language de duplication operation unique duplicate filter
Livedata source code appreciation III - frequently asked questions
数据库 自动增长
100 important knowledge points that SQL must master: summary data
对象映射 - Mapping.Mapster
限时预约|6 月 Apache Pulsar 中文开发者与用户组会议
R language view version R package view version
Evaluation of IP location query interface Ⅲ
Handler-源码分析
暑假学习记录
Introduction to China Mobile oneos development board