布局分类
紧凑型:默认使用自身大小
Text
VZstack HStack ZStack
贪婪型:默认填充父容器大小
Circle
GeometryReader 读取上层容器大小
紧凑转贪婪
.frame(maxWidth:.infinity, maxHeight:.infinity)
贪婪转紧凑
.frame(width:100, height:100)
布局大小
.frame()
.frame()
布局位置
offset
position
布局大小
layoutPriority
GeometryReader
布局对齐
AnchorPreferences
Alignment Guides
线性布局,填充剩余空间
VStack{
ZStack{
}
.