Android ViewGroup and view touch screen basic Event Ontouch processing

Source: Internet
Author: User

Distribution Event: Dispatchtouchevent

Truncation event:intercepttouchevent

Touch Event: OnTouch

  1. The parent view's distribution event returns TRUE, the parent view handles touch event events, the parent view touch event returns false, is handled by the activity where it is located, and returns True, and can still receive touch events;

  2. The parent view's distribution event returns false, truncating the event trigger;

  3. Truncation events return true, handle touch events on their own, and do not leave the child view to handle;

  4. Truncation event returns false, child view distribution event;

Truncation event false, processing event true, child view processing event is true, parent view can receive events but not process, sub view processing;

Truncation event false, handling event true, child view processing event false, parent view processing, child view not processing;

Truncation event true, which handles event true, the parent view handles the event, and the child view is not processed;

Truncate event true, handle event false, parent view is also not handled by the activity where the event is handled;

This article is from "Hjh BK" blog, please make sure to keep this source http://hjhit.blog.51cto.com/8318005/1538010

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.