Modifiers (修飾符)

padding (內邊距)

VStack() {
    Text("A")
    Text("B")
    Text("C")
}.padding()

frame (限制尺寸)

fixedSize (根據內容計算尺寸)

aspectRatio (長寬比例)

layoutPriority (空間分配優先度)

offset (位移)

Text("Hello")
    .offset(x: 100)

position (座標)

Text("Hello")
    .position(x: 50, y: 100)

alignmentGuide (對其指南)

HStack(alignment: .firstTextBaseline, spacing: 10) {
    Text("HStack")
    Text("HStack")
        .alignmentGuide(.firstTextBaseline) { dimension in
            dimension[.bottom]
        }
}

foregroundColor (前景色)

background (背景)

overlay (疊加)

Text("Hello")
    .padding()
    .background(Color.blue)
    .overlay(
        Circle()
            .fill(Color.red)
            .frame(width: 10, height: 10),
        alignment: .topTrailing
    )

opacity (透明度)

shadow (陰影)

clipShape (剪裁)

索引