这节课杨武老师讲了Image和动画的制作
越来越复杂的iOS设备...

导致Image管理的复杂...
Assert Catalog


Demo1:
- 完成后的样子:

- Tips:
-
矢量图需要开这个选项
矢量图选择.png
-
边框的边缘可以选择不缩放
四周不缩放.png
Demo2:动画
- 代码
//创建数组(图片以vectanimx命名)
UIImage image=[UIImage animatedImageNamed:@"vectanim" duration:3];
NSArray<UIImage> *imageArray = [NSArray arrayWithArray:image.images];
//赋值
self.animatedImageView1.animationImages=imageArray;
//周期时间
self.animatedImageView1.animationDuration=3;
//重复次数,0为无限制
self.animatedImageView1.animationRepeatCount=1;
//开始
[self.animatedImageView1 startAnimating];
[self performSelector:@selector(stopImage) withObject:nil afterDelay:3];
网友评论