2016-07-19 6 views

答えて

0

このバグの修正が、ないボタンのビューCGAffineTransformMakeRotationCABasicAnimationを適用することです。

ビューに何らかの理由でそれを適用すると、フレームとAutoLayoutが混乱します。詳細情報here。ここで

は、この修正プログラムを実装する方法は次のとおりです。

let animation = CABasicAnimation(keyPath: "transform.rotation") 
animation.autoreverses = false 
animation.duration = 0.3 
animation.fromValue = 0 
animation.fillMode = kCAFillModeForwards 
animation.removedOnCompletion = false 
animation.toValue = 3.14/4 // 45 degrees 
self.myButton.layer.addAnimation(animation, forKey: "45rotation") 
関連する問題