0
我有我的應用程序的其他許多地方使用動畫功能,它完美的作品:我不能動畫UICollectionViewCell子類或任何它的子視圖
class func pulse(view: UIView, sizeMultiplier: Float, duration: NSTimeInterval, repeatCount: Float = 1.0) {
let pulseAnimation = CABasicAnimation(keyPath: "transform.scale")
pulseAnimation.duration = duration
pulseAnimation.toValue = NSNumber(float: sizeMultiplier)
pulseAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
pulseAnimation.autoreverses = true
pulseAnimation.repeatCount = repeatCount
view.layer.addAnimation(pulseAnimation, forKey: nil)
}
出於某種原因,不過,我可以」牛逼動畫細胞在我UICollectionView
在我didSelectItemAtIndexPath
功能(這是被稱爲,我用的斷點檢查),我有這樣的:
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! ModuleCell
Animations.pulse(cell, sizeMultiplier: 2.0, duration: 0.2, repeatCount: 2)
任何想法?
非常感謝你!!!!! – shakked
@shakked歡迎您,很高興幫助! – luk2302