ios - How to add UIImages like animation using NSTimer? -
ios - How to add UIImages like animation using NSTimer? -
i want add together array of uiimages uiimageview using nstimer. such animation. how in ios? in advance.
there simple way it.
// create view execute our animation uiimageview* campfireview = [[uiimageview alloc] initwithframe:self.view.frame]; // load frames of our animation campfireview.animationimages = [nsarray arraywithobjects: [uiimage imagenamed:@"campfire01.gif"], [uiimage imagenamed:@"campfire02.gif"], [uiimage imagenamed:@"campfire03.gif"], [uiimage imagenamed:@"campfire04.gif"], [uiimage imagenamed:@"campfire05.gif"], [uiimage imagenamed:@"campfire06.gif"], [uiimage imagenamed:@"campfire07.gif"], [uiimage imagenamed:@"campfire08.gif"], [uiimage imagenamed:@"campfire09.gif"], [uiimage imagenamed:@"campfire10.gif"], [uiimage imagenamed:@"campfire11.gif"], [uiimage imagenamed:@"campfire12.gif"], [uiimage imagenamed:@"campfire13.gif"], [uiimage imagenamed:@"campfire14.gif"], [uiimage imagenamed:@"campfire15.gif"], [uiimage imagenamed:@"campfire16.gif"], [uiimage imagenamed:@"campfire17.gif"], nil]; // frames execute in 1.75 seconds campfireview.animationduration = 1.75; // repeat annimation forever campfireview.animationrepeatcount = 0; // start animating [campfireview startanimating]; // add together animation view main window [self.view addsubview:campfireview];
source: http://web.archive.org/web/20120305060003/http://appsamuck.com/day2.html
ios nstimer
Comments
Post a Comment