1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

これで完全に理解SwiftUI frame minWidth maxWidth

Posted at

理解が曖昧だったminWidth maxWidthについて調査してみました。
この場合この法則が崩れるorこの場合はどの法則にも当てはまらないみたいなことがあったら教えてください!
idealWidth&idealHeightはわかりません!!!

minWidthのみ

  • 親Viewか子ViewどっちかよりminWidthが大きければminWidthになる
  • 親Viewと子Viewの両方よりminWidthが小さいとき親Viewと子Viewの小さい方に合わせる

maxWidthのみ

  • 親Viewと子Viewの大きい方に指定した値まで大きくなる

minWidth & maxWidth

  • minWidthが親Viewより大きい場合minWidthに指定した値になる
  • minWidthが親Viewより小さい場合maxWidthまで親Viewに合わせる
  • minWidthが親Viewと子Viewの両方より小さいときmaxWidthまで親Viewに合わせる

参考

1
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?