LoginSignup
2
3

More than 5 years have passed since last update.

UIStackViewを使ってViewを等間隔に並べる

Last updated at Posted at 2016-11-30

UIStackViewの子Viewの並べ方に関する設定項目

  • Axis
    • 並べる方向
      • Vertical
      • Horizontal
  • Alignment
    • Viewの揃え方
      • Fill
      • Top
      • Center
      • Bottom
      • First Baseline
      • Last Baseline
  • Distribution
    • 並べる方向に対するViewの並べ方
      • Fill
      • Fill Equally
      • Fill Proportionally
      • Equal Spacing
      • Equal Centaring
  • Spacing
    • 子View同士の間隔

実際に並べてみる

UIStackViewにButtonを2つ、StackViewを2等分するように配置するには以下のように設定する

Axis:Horizontal
Alignment:Fill
Distribution:Fill Equally
Spacing:0

スクリーンショット 2016-11-30 21.02.11.pngスクリーンショット 2016-11-30 20.56.00.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3