Ioq*_*uai 1 uiscrollview ios swift
我确实有一个UIScrollView可以容纳几个的UIViewController。对于里面的元素UIViewController我使用了自动布局。现在,如果当前设备是 iPhone 4,我想更改视图约束的常量。因此我updateViewConstraints()重写UIViewControllers:
override func updateViewConstraints() {
if (self.view.frame.height == 480) {
self.imageMarginLeft.constant = 40
self.imageMarginRight.constant = 40
self.textMarginTop.constant = 10
println("updateViewConstraint \(self.imageMarginRight.constant)")
}
super.updateViewConstraints()
}
Run Code Online (Sandbox Code Playgroud)
但即使println记录了正确的新常量,更新也是不可见的。我在实施中需要改变什么?
| 归档时间: |
|
| 查看次数: |
4208 次 |
| 最近记录: |