stackviewを使って等サイズ等間隔に要素を配置したい。
パターン
- StackView + Constraints
- StackView
- こっちのほうが好き
StackView + Constraints
- StackViewに要素を配置し、要素同士を
Equal widths
で揃える - 要素間の間隔はStackViewのプロパティ
Spacing
で調整する
StackView
- StackViewに要素を配置し、StackViewのプロパティ
Distribution
をFill Equally
にする - 要素間の間隔はStackViewのプロパティ
Spacing
で調整する
所感
Constraintsを定義する必要がない後者の手法が好き。