ios - Animating UIView and Mask -
i have uiimageview mole. want mole pop out of hole. have in mind create mole points below hole , have mask on , animate image view looks popping out of hole. following thought , had made written down code :
cashapelayer *masklayer = [[cashapelayer alloc] init]; cgrect maskrect = _moleicon.frame; cgpathref path = cgpathcreatewithrect(maskrect, null); masklayer.path = path; cgpathrelease(path); _moleicon.layer.mask = masklayer; [uiview animatewithduration:2.0 animations:^(void){ _moleicon.transform=cgaffinetransformmaketranslation(0, 50); }];
but problem, seems mask moving actual uiimageview. highly appreciated.
try use 2 uiviews, maskview should bring front:
[superview bringsubviewtofront:maskview];
and set background color , alpha property mask view,
maskview.backgroundcolor = [uicolor blackcolor]; maskview.alpha = 0.8;
and can move 2 view directly.
but better add 2 view other view - container, , rotate 1 view.
Comments
Post a Comment