简体   繁体   中英

Passing touches from UIImageView to superview

I have four UIImageViews placed on a circular UIView . Dragging the UIView rotates the view. But when I drag the UIImageView, the rotation does not occur. The UIImageView is eating the touches.

I subclassed the UIImageView and tried this:

- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    [self.superview touchesMoved:touches withEvent:event];
    [super touchesMoved:touches withEvent:event];
}

That doesn't seem to solve the problem. I tried disabling touches on the UIImageView - [imageView setUserInteraction:NO] . That doesn't solve the problem either. I know there are similar questions been asked. But none seem to solve my problem.

Thanks.

尝试在UIImageView上将userInteractionEnabled设置为NO ,这样可以防止他们消耗触摸。

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