Comments (5)
@MaAnQing 这段是伪代码,主要是为了描述三者之间的关系,并非实际的代码。
from android-art-res.
@singwhatiwanna 我知道这是伪代码,按照这段伪代码可知当onInterceptTouchEvent(ev)返回为true时才会调用onTouchEvent(ev),但我在实际开发中,我遇到onInterceptTouchEvent返回false时仍会触发onTouchEvent事件,这样是不是就说明上述为代码有问题,是不是说明三者之间的关系并非为上述为伪代码所描述的那样
from android-art-res.
onInterceptTouchEvent返回false表示ViewGroup不拦截这个事件,自然会分发到子View,但是如果子View的onTouch/onTouchEvent同样返回false,即子View不处理该事件,事件又会回到上级ViewGroup处理,即你说的调用onTouchEvent.刚看本书,不知理解是否正确
from android-art-res.
@MaAnQing 你说的那个问题书中有详细说明,我也理解。上面那段伪代码,如果考虑到各种情况,那就不能那么简洁了,就没有意义了,还请分别去理解。
from android-art-res.
@kutear 应该就是你讲的那样,没有验证
from android-art-res.
Related Issues (20)
- [勘误]3.1.4部分 HOT 1
- 使用书中的12章节的Imageloader加载图片会报java.io.FileNotFoundException
- 使用书中的12章节的Imageloader加载图片会报java.io.FileNotFoundException HOT 1
- 第十二章的ImageLoader为什么总也不会从内存缓存里读取图片?都只有从Httpt和Disk里读取图片。
- ContentProvider中定义的权限,本应用中使用是否不需要验证权限? HOT 1
- 第三章点击事件的结论,第五个怎么理解? HOT 2
- [error] P268 页中scale、rotate的pivotX、pivotY默认都为0,而不是view的中心点 HOT 2
- 第三章的stickylayout没有源码 HOT 2
- 10.2.1节 ThreadLocal实现方式改变
- 对象存储到本地磁盘
- Context的设计模式怎么看得出的是桥接模式?
- 请问有AndroidStudio版本吗? HOT 2
- 通过各种姿势clone都没法完整下载,求个云盘地址 HOT 1
- “和”与“或” HOT 2
- 关于ViewGroup的事件分发
- 第二章,binder连接池部分, 未unbindservice, 请问这种处理考虑是什么呢?
- 第二章的AIDL无法引用到aidl文件中的Book类,教程中说将内容都放置在同一文件夹中。若想分开则应该怎么才能引用到Book.java HOT 1
- 事件分发
- 外部拦截,有点问题请教一下
- 更新下代码 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-art-res.