0
をアニメーション化するときCenterX制約光栄ではない私はCartography を使用してこのコードを使用してUILabelをアニメーション化しようとしている:地図作成法:
let group = ConstraintGroup()
constrain(alertLabel, replace: group) { alertLabel in
alertLabel.centerX == alertLabel.superview!.centerX
alertLabel.width == alertLabel.superview!.width * Constants.alertLabelWidthMultiplier
alertLabel.bottom == alertLabel.superview!.top + 0
}
constrain(alertLabel, replace: group) { alertLabel in
alertLabel.centerX == alertLabel.superview!.centerX
alertLabel.width == alertLabel.superview!.width * Constants.alertLabelWidthMultiplier
alertLabel.bottom == alertLabel.superview!.top + 60
}
UIView.animateWithDuration(0.5, animations: alertLabel.layoutIfNeeded)
私はUILabelはを中心にしたいですアニメーションの始まりと終わり。 しかし、代わりにスーパービューの左上隅から始まるようです。 ここで何が間違っていますか?