iphone image change with motion -


hi there way set image [uiimage image named@"abc.png"] motion effect means image should not changed @ once , need change slow motion effect user can see image changing .

thanks in advance

* method 1 perform animation *

step 1 : add following framework in project , import .m file

#import <quartzcore/quartzcore.h> 

step 2 : write following code in imagechange method

imageview.image = [uiimage imagenamed:@"newimage.jpg"];  catransition *transition = [catransition animation]; transition.duration = 1.0f; transition.timingfunction = [camediatimingfunction functionwithname:kcamediatimingfunctioneaseineaseout]; transition.type = kcatransitionfade;  [imageview.layer addanimation:transition forkey:nil]; 

* method 2 perform animation *

[uiview transitionwithview:yourimageview               duration:0.2f                options:uiviewanimationoptiontransitioncrossdissolve             animations:^{                 yourimageview.image = newimage;             } completion:null]; 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -