티스토리 뷰

📱 SwiftUI

shadow

James Wetzel 2023. 5. 20. 14:22
728x90
반응형

1. Basic Shadow:

.shadow(color: Color.black.opacity(0.2), radius: 4, x: 0, y: 2)


2. Colored Shadow:

.shadow(color: Color.blue.opacity(0.4), radius: 8, x: 0, y: 4)


3. Inner Shadow:

.shadow(color: Color.black.opacity(0.6), radius: 8, x: 0, y: 0)
.shadow(color: Color.white.opacity(0.4), radius: 8, x: 0, y: 0)


4. Gradient Shadow:

.background(
    LinearGradient(gradient: Gradient(colors: [Color.red, Color.blue]), startPoint: .top, endPoint: .bottom)
        .shadow(color: Color.black.opacity(0.4), radius: 8, x: 0, y: 4)
)

 

728x90
반응형