当我添加带有约束的新标签时,UIView.animation无法正常工作
UIView.animate(withDuration: 1, delay: 0, usingSpringWithDamping: 0.1, initialSpringVelocity: 0.5, options: .curveEaseOut, animations: {
self.answerLabels[i].center.y = self.view1.center.y + self.wordMainLabel.frame.height/2 + self.answerLabels[i].frame.height/2
})
此代码有效,直到我向view1添加一个带有约束的新标签