【问题标题】:Animated Image animationRepeatCount CollectionViewCell动画图像动画RepeatCount CollectionViewCell
【发布时间】:2015-02-20 23:39:47
【问题描述】:

我有一个非常简洁的动画,它基本上为集合视图单元格绘制了一个边框。

我的动画效果很好,我无法让它无限期地重复。

在:func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

我是这样设置单元格的:

var image = UIImage.animatedImageNamed("Shape + Oval ", duration: 0.5)

    cell.cellImageView.animationRepeatCount = 1
    cell.cellImageView.image = image

为什么animationRepeatCount 没有阻止我的单元格图像不断循环

【问题讨论】:

    标签: ios swift animation uicollectionview uicollectionviewcell


    【解决方案1】:

    您在 UIImageView 中混合了两种不同的动画动画方法 - 您正在提供动画 UIImage,但随后尝试通过 UIImageView 属性控制动画。

    您应该创建一个UIImage 对象数组,而不是使用动画UIImage,并使用它来设置cell.imageViewanimationImages 属性。然后您可以通过cell.imageView.animationDurationcell.imageView.animationRepeatCount 控制持续时间

    【讨论】:

      猜你喜欢
      • 2014-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-14
      • 2014-08-31
      • 2013-05-26
      相关资源
      最近更新 更多