【发布时间】:2015-08-04 16:38:38
【问题描述】:
我在 IB 中定义了一个约束,如下所示。如何以编程方式动画将此约束中的“第二项”更改为不同的对象(有效地将第一项移动到屏幕上)。
这是我尝试过的代码 - 其中“categoryTableViewTop”是 NSLayoutConstraint。我收到错误“无法分配给此表达式的结果”。
func expandCategory(button: UIButton) {
tableView2.animateWithDuration(0.5, animations: {
categoryTableViewTop.secondItem = categoryHeader.top
})
}
【问题讨论】:
标签: ios swift interface-builder uiviewanimation nslayoutconstraint