LoginSignup
2
2

More than 3 years have passed since last update.

Content Hugging PriorityとContent Compression Resistance Priorityまとめ(StackView)

Last updated at Posted at 2019-08-04

概要

Content Hugging PriorityContent Compression Resistance Priorityは主にUIStackViewで使うもので、
制約と組み合わせると(こいつ自身も制約といえば制約だけど)
UIStackView内で大きさが可変する可能性のあるUIをうまく管理できる

詳しい内容は後で追記
・親Viewやデバイスの大きさが中のコンテンツ(=子View)(priorityを適用するView)
より大きい
Content Compression Resistance Priority低い方が縮む
より小さい
Content Hugging Priority低い方が余白で広がって埋める

参考記事

Auto Layoutで固有サイズを使いこなそう | Money Forward Engineers' Blog
StackViewの優先度 Content Hugging PriorityとContent Compression Resistance Priority
今更だけど正しく身につけよう『Content Hugging Priority』と『Content Compression Resistance Priority』 - Takahiro Octopress Blog
【Swift】Compression Registance PriorityとContent Hugging Priorityをコードから考える - Qiita

2
2
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
2