English 中文(简体)
如何在次调查中发现主食
原标题:How to detect a tap gesture in subviews

问 题: 如何发现主食的识别器是否属于添加到该观点的亚述范围? 例如,如果在添加了主角姿态识别器的背景下点击像已添加的广场这样的物体,我如何发现它已被利用?

最佳回答

在请您使用<条码>-所在地点表示的任何意见时,请您在接手方法时,打断机号。 然后,使用以下电离层识别法:-(UIView *)hit Testpoint with Event:Event *)event,以提及实际的分辨率,该次意见被利用后忘记,你所传递的点与所认为的同一协调空间。

启动一些法典:

CGPoint point = [tapGestureRecognizer locationInView:parentView];
UIView *tappedView = [parentView hitTest:point withEvent:nil];

为进行点击测试,需要将<代码>用户间可操作<>> 编码>财产设定为<代码>YES。 许多观点,例如<代码> UILabels 依违约将这一编号改为NO。 此前:

self.subviewOfInterest.userInteractionEnabled = YES;
问题回答

maybe you should set as: subviews.userInteractionEnabled = YES; good luck!

you can use the requireGestureRecognizerToFail: to recognize the tap on subview please refer this code





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签