ios UIImageView添加图片动画效果,添加了手势之后,依然没有反应的解决方法
UIImageView添加图片动画效果
[super viewDidLoad];
imgView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
NSMutableArray *arrayImg=[NSMutableArray array];
[arrayImg addObject:[UIImage imageNamed:@"1.png"]];
[arrayImg addObject:[UIImage imageNamed:@"2.png"]];
[arrayImg addObject:[UIImage imageNamed:@"3.png"]];
[arrayImg addObject:[UIImage imageNamed:@"4.png"]];
[arrayImg addObject:[UIImage imageNamed:@"5.png"]];
[arrayImg addObject:[UIImage imageNamed:@"6.png"]];
[imgView setAnimationImages:arrayImg];
[imgView setAnimationDuration:1];
[imgView setAnimationRepeatCount:20];
[imgView startAnimating];
// [imgView setUserInteractionEnabled:YES]; //需要设置该属性可以实现人机交互
[self.view addSubview:imgView];
比如在UI