简体   繁体   中英

touch events view and subview

I have a view and a subview. I add the subview in the loadView method in my viewController. The first time a touch even occurs it goes to the view, and all subsequent touches go to the subview. Why is it that this happens, and how would I be able to change it so that both the view and subview see all touch events?

See the touchesBegan:withEvent: method reference discussion

To forward the message to the next responder, send the message to super (the superclass implementation); do not send the message directly to the next responder. For example,

[super touchesBegan:touches withEvent:event];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM