uiimageview - Animate image from array with animation style -
i have 3 images in array sample code animate without style .i want animate fade in fade out style.
nsarray *imarray = [[nsarray alloc] initwithobjects: [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/lady1_open.png", path]], [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/lady1_open2.png", path]], [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/lady1_open3.png", path]], nil]; bingo_girl.animationimages=imarray; bingo_girl.animationduration=5; bingo_girl.animationrepeatcount=0; [bingo_girl.layer addanimation:transition forkey:nil]; [bingo_girl startanimating];
you may animate images transition manually example using category
@implementation uiimageview (animatetransition) - (void) assignimage:(uiimage *)image withtransition:(nsstring *)withtransition withdirection:(nsstring *)withdirection{ if(image == nil) { [self setimage:nil]; return; } if ([uiimagepngrepresentation(self.image) isequaltodata:uiimagepngrepresentation(image)]) { return; } catransition *animation = [catransition animation]; animation.duration = 0.2; animation.type = withdirection; animation.subtype = withdirection; [[self layer] addanimation:animation forkey:@"imagefade"]; [self setimage:image]; } @end
Comments
Post a Comment