1. 调节 imageview的图片 使其自适应
imageview.contentMode = UIViewContentModeScaleAspectFit;
2.
self.tomcatImage.animationDuration = 0.1 * self.pictureArray.count;// 每张图片执行0.1秒
self.tomcatImage.animationImages = self.pictureArray;// 需要执行动画的图片
self.tomcatImage.animationRepeatCount = 1;// 动画重复次数(0为无限重复)
if (YES == self.tomcatImage.isAnimating) return; //如果当前正在播放动画, 返回
本文介绍了如何使用UIImageView实现图片自适应显示及动画效果。通过设置contentMode为ScaleAspectFit达到自适应效果,并通过配置animationDuration、animationImages和animationRepeatCount等属性实现动画播放。
355

被折叠的 条评论
为什么被折叠?



