全景动画

作者: 失忆的程序员 | 来源:发表于2016-09-06 21:05 被阅读12次

#在界面上添加图片容器

## UIImageView关联界面上的图片容器

@property (weak, nonatomic) IBOutlet UIImageView *imageContainer;

##定义容易保存所有图片

// 1.定义容器保存所有图片

NSMutableArray *arrM =[NSMutableArray array];

// 2.加载所有图片

for (int i = 1; i <= 36; i++) {

NSString *imageName = [NSString stringWithFormat:@"img_360car_black_%02d", i];

UIImage *image = [UIImage imageNamed:imageName];

[arrM addObject:image];

}

// 3.将图片设置给图片容器

self.imageContainer.animationImages = arrM;

// 4.监听屏幕点击方法

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

// 1.设置动画时长

self.imageContainer.animationDuration = 5;

// 2.设置动画重复次数

self.imageContainer.animationRepeatCount = 1;

// 3.开始动画

[self.imageContainer startAnimating];

}

相关文章

网友评论

    本文标题:全景动画

    本文链接:https://www.haomeiwen.com/subject/rfzdettx.html