Apple Developer Documentation による AutoLayoutbyExample
スペーサー ビューを作成して、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 でスペーサーを作成して、ラベル間の幅が常に等しくなるようにする方法を考えていましたが、優先度は最低でした。