๐ฐview layout
SwiftUI layout system:
Parent proposes a size for child.
Child chooses its own size.
Parent places child in parentโs coordinate space.
SwiftUI views manage size in different ways:
"push-out" views: expand to fill space offered by parent. ๐
Color
,LinearGradient
,Circle
..."pull-in" views: have ideal size that varies according to their contents. ๐
Text
, container views (HStack, VStack , ...)"fixed" views: have ideal size that never varies. ๐
Toggle
orDatePicker
...
็ฅไน โฉ SwiftUI ๆ็ฅไน่ทฏ โฉ SwiftUI ไน Layout ๅบ็ค็ฏ
GeometryReader is often used to do custom layout.
Cannot convert value of type 'Self' to expected argument type 'Binding<C>' โ๏ธ error occurred when designing protocol for layout.
Last updated
Was this helpful?