首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 平面设计 > 图形图像 >

UIImageView的animationImages兑现动画

2013-02-18 
UIImageView的animationImages实现动画UIImageView的animationImages实现动画 // create the view that wi

UIImageView的animationImages实现动画

UIImageView的animationImages实现动画

 


// create the view that will execute our animation

UIImageView* campFireView = [[UIImageView alloc] initWithFrame:self.view.frame];

// load all the 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"],nil];

// all frames will execute in 1.75 seconds

campFireView.animationDuration = 1.75;

// repeat the annimation forever

campFireView.animationRepeatCount = 0;

// start animating

[campFireView startAnimating];

// add the animation view to the main window

[self.view addSubview:campFireView];

[campFireView release];

热点排行