🔸view size
SwiftUI ⟩ view ⟩ layout ⟩ size
SwiftUI has built-in views that manage size in different ways:
Expanding to fill the available space (offered by their parent): (
Color,LinearGradient,Circle...)Resizing to fit their content: (have an ideal size that varies according to their contents) (
Text, container views ...)Maintaining a specific size that doesn't change: (have an ideal size that never varies) (
Toggle,DatePicker...)
view hierarchy:parent view proposes a size to the child views it contains, and the child views respond with a computed size.
Differennt type of views have their own space requirements within a container.
Last updated