Frontend/Swift

shadow with radius

괴발새발자 2023. 4. 18. 14:43

https://stackoverflow.com/questions/58933590/how-to-give-shadow-with-cornerradius-to-a-button-in-swiftui

How to give shadow with cornerRadius to a Button in SwiftUI

I'm trying to give a shadow to Button using following code. Code: Button(action: { }) { Text("SIGN IN") .font(.system(size: 17)) ...

stackoverflow.com

원하는 뷰가 radius를 가지면서 shadow를 주는 법
 

.background(
            RoundedRectangle(cornerRadius: 25)
                .fill(Color.white)
                .shadow(color: .gray, radius: 2, x: 0, y: 2)