objective c - UIView can't move after masking image -
i have uiview
uiimage
property. masking image , adding uiview
. once have clipped mask image gestures no longer work.
masking code:
cgcontextref ctx = uigraphicsgetcurrentcontext(); ... // creating mask cgcontextclip(ctx); [self.image drawinrect:cgrectmake(0, 0, self.bounds.size.width, self.bounds.size.height)]; cgcontextdrawpath(ctx, kcgpathstroke);
gesture code:
- (void)move:(uipangesturerecognizer*)gesture { cgpoint translation = [gesture translationinview:self.superview]; cgrect currentframe = self.frame; currentframe.origin.x = self.frame.origin.x + translation.x; currentframe.origin.y = self.frame.origin.y + translation.y; self.frame = currentframe; [gesture settranslation:cgpointzero inview:self.superview]; }
if remove line: cgcontextclip(ctx);
gestures work fine. suggestions appreciated.
Comments
Post a Comment