iphone - UIButton inside a view that has a UITapGestureRecognizer -
I have a view with a UITapGestureRecognizer
. So when I tap on the scene, another view appears above this view. This new scene has three buttons when I now press one of these buttons, I do not get the button action, I get tap gesture action, so I can not use these buttons anymore. What can I do to get the events through these buttons? The strange thing is that the buttons are still highlighted.
After getting the tap, I can not only remove the UITAP Jester Ranger because as well as the new view can be removed as well. I mean behave like full-screen visual controls .
You can set your controller as a representative of UITapGestureRecognizer
or The view (which also creates the gesture identifier) can then apply to the - ogorian in the representative: Resigve touch:
. In your implementation, you can test whether the touch comes under your new subview, and if this happens then instruct the gesture identifier to protect it. Something like the following:
- (BOOL) sign: Identifier: (UIGestureRecognizer *) The gesture identifier should be Recieve Touch: (UITouch *) touch {// test If our control subview is on-screen If (self.controlSubview .superview! = Zero) {If ([touch.view isDescendantOfView: self.controlSubview]) // // We have not touched our control surface return; // ignore touch}} return yes; // handle the touch}
Comments
Post a Comment