1
当动画UILabel帧大小改变它在iOS9上工作,但不在iOS8上(在iOS8上它跳转到最终状态,而不是动画)。使用UIView或iOS9时,此问题消失。UILabel帧大小动画不工作在ios8
什么会导致此问题? (你可以看到这个项目在https://github.com/IdoNave/UIlabelAnimation)
class MyView: UIView {
var progrssLabel: UILabel?
func startProgreesAnimation(from: CGFloat, duration: Double) {
if progrssLabel == nil {
progrssLabel = UILabel(frame: CGRect(x: 0, y: 0, width: frame.width * from, height: frame.height))
progrssLabel?.backgroundColor = UIColor.redColor()
self.addSubview(progrssLabel!)
}
UIView.animateWithDuration(duration, delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: {
self.progrssLabel!.frame = self.bounds
}) { (finish) in
print("ProgreesAnimation ended")
}
}
}
究竟在哪里?在将它添加到MyView或调用此动画的viewController时,它没有解决问题。 –
http://stackoverflow.com/questions/12622424/how-do-i-animate-constraint-changes?rq=1 –
不幸的是它没有解决问题:( –