【发布时间】:2020-02-20 22:15:49
【问题描述】:
UIView button 的宽度为 44,它应该以动画方式展开到 90。目前,当动画开始时,它会将视图重新对齐到 44 宽度的中心,然后将左右两侧都展开到 90。
self.button.widthConstraint?.isActive = false
self.button.width(90)
UIView.animate(
withDuration: animationDuration,
animations: {
self.layoutIfNeeded()
}
)
如何仅从右侧对展开进行动画处理?我希望左边被固定,而右边增加它的 x 位置。
【问题讨论】:
标签: ios swift animation uiview