🔰container + shadow

SwiftUIviewdrawingshadow ⟩ container + shadow

VStack(spacing: 30) {
    Text("Hello")
    Image(systemName: "fish")
}
.foregroundColor(.teal)
.border(.teal, width: 3)
.background(.white) // 1. container + background color (如果沒加,還是會產生多個陰影)
.compositingGroup() // 2. compositing group ⭐️ 
.shadow(radius: 3, x: 6, y: 6)    // 3. 陰影

Last updated

Was this helpful?