您的位置:首页 > 编程语言

多张图片整合成连续动画的代码

2012-12-29 17:54 239 查看
循环播放的代码

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

animView.animationImages = [NSArray arrayWithObjects:

[UIImage imageNamed:@"01.gif"],

[UIImage imageNamed:@"02.gif"],

[UIImage imageNamed:@"03.gif"],nil];

// all frames will execute in 1.75 seconds

animView.animationDuration = 1.75;

// repeat the annimation forever

animView.animationRepeatCount = 0;

// start animating

[animView startAnimating];

// add the animation view to the main window

[self.view addSubview:animView];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: