Setting space between some items in stack view

后端 未结 6 508
悲&欢浪女
悲&欢浪女 2021-02-04 23:35

In Interface Builder, I use a horizontal UIStackView and want to place the items as this :

   xx   xx   xx

every x symbolize an item. Item1 and

6条回答
  •  后悔当初
    2021-02-05 00:22

    Programmatically for each view:

    stackView.spacing = 10.0
    

    If you want to make a custom spacing after each view and you need to support lower than iOS11:

    Create a clear UIView with height and add it as an addArrangedSubview into the stackView.

提交回复
热议问题