1
label.snp.makeConstraints { (make) -> Void in

        make.width.equalTo(box).dividedBy(2)

        make.top.equalTo(100)

        make.left.greaterThanOrEqualTo(box.snp.left).offset(15)
}

我想把这个动画label到另一个位置button

4

1 回答 1

3

更新约束后,在动画闭包中对视图调用 layoutIfNeeded()。

    UIView.animateWithDuration(0.2, delay: 0, options: [], animations: { () -> Void in 
       self.view.layoutIfNeeded()
    })

希望这可以帮助。

于 2016-09-22T11:41:18.880 回答