Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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
label
button
更新约束后,在动画闭包中对视图调用 layoutIfNeeded()。
UIView.animateWithDuration(0.2, delay: 0, options: [], animations: { () -> Void in self.view.layoutIfNeeded() })
希望这可以帮助。