The use of Ioshittest

Source: Internet
Author: User

Yesterday, a bug was sent. A third-party control has been applied. All good, the effect comes out to meet the requirements.

When you are ready to finish, test again, and find a very serious consequence of the Bug,view on the button event is gone.

After a variety of tests, it was discovered that the newly introduced third-party control was caused.

Step through the comments code. Found

(ID) HitTest: (cgpoint) point withevent: (uievent *) event usage caused, see here suddenly, this method commented out, everything is normal.

HitTest function: When a shield is added to a view, but does not affect the operation of the view below, that is, the following view can be manipulated through the shielding hood, this function is very useful.

HitTest usage: Add the following function to the UIView subclass, which is the Mask class.

-(ID) hitTest: (cgpoint) point withevent: (Uievent *) event

{

UIView *hitview = [Super Hittest:point withevent:event];

if (Hitview = = self)

{

return nil;

}

Else

{

return hitview;

}

}

In the third-party control code, the Superview is returned, causing the problem.

Now when is the review, the previous knowledge, write a thing, record.

View can be displayed beyond the parent view, but cannot handle events.

Important events say three times:

View can be displayed beyond the parent view, but cannot handle events,-(ID) hitTest: (cgpoint) point withevent: (Uievent *) event

View can be displayed beyond the parent view, but cannot handle events,-(ID) hitTest: (cgpoint) point withevent: (Uievent *) event

View can be displayed beyond the parent view, but cannot handle events,-(ID) hitTest: (cgpoint) point withevent: (Uievent *) event

can cause problems, there is the event to be registered to the corresponding target.

The use of Ioshittest

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.