AutoLayoutbyExample 通过 Apple 开发者文档
任何人都有一个如何创建间隔视图以在 VFL 中设置标签之间的间距相等的示例?
labelsDictionary = [ "label1": label1,
"label2": label2,
"label3": label3,
"label4": label4 ]
let metrics = ["edgeSpacing": 20, "spacingBetween": 5, "labelWidth": 50]
let constraints = "H:|-(==edgeSpacing)-[label1(==labelWidth@999)]-[label2(==label1)]-[label3(==label1)]-[label3(==label1)]-[label4(==label1)]-(==edgeSpacing)-|"
self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat( format : constraints,
options : .allZeros,
metrics : metrics,
views : labelsDictionary))
我只是想知道如何在 Swift 中创建垫片以确保标签之间的宽度始终相等但优先级最低。