Git Product home page Git Product logo

Comments (5)

singwhatiwanna avatar singwhatiwanna commented on May 27, 2024

@MaAnQing 这段是伪代码,主要是为了描述三者之间的关系,并非实际的代码。

from android-art-res.

madroidmaq avatar madroidmaq commented on May 27, 2024

@singwhatiwanna 我知道这是伪代码,按照这段伪代码可知当onInterceptTouchEvent(ev)返回为true时才会调用onTouchEvent(ev),但我在实际开发中,我遇到onInterceptTouchEvent返回false时仍会触发onTouchEvent事件,这样是不是就说明上述为代码有问题,是不是说明三者之间的关系并非为上述为伪代码所描述的那样

from android-art-res.

kutear avatar kutear commented on May 27, 2024

onInterceptTouchEvent返回false表示ViewGroup不拦截这个事件,自然会分发到子View,但是如果子View的onTouch/onTouchEvent同样返回false,即子View不处理该事件,事件又会回到上级ViewGroup处理,即你说的调用onTouchEvent.刚看本书,不知理解是否正确

from android-art-res.

singwhatiwanna avatar singwhatiwanna commented on May 27, 2024

@MaAnQing 你说的那个问题书中有详细说明,我也理解。上面那段伪代码,如果考虑到各种情况,那就不能那么简洁了,就没有意义了,还请分别去理解。

from android-art-res.

madroidmaq avatar madroidmaq commented on May 27, 2024

@kutear 应该就是你讲的那样,没有验证

from android-art-res.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.