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.

enter image description here

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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -