Question : how to show one gray layer on top of the button in swiftui
Answered by : glorious-grouse-q7bad6vk50mc
struct ContentView: View { var body: some View { Text("Swift by Sundell") .foregroundColor(.white) .font(.title) .padding(35) .background( LinearGradient( colors: [.orange, .red], startPoint: .topLeading, endPoint: .bottomTrailing ) .frame(width: 300, height: 300) ) .cornerRadius(20) }
}
Source : https://www.swiftbysundell.com/articles/backgrounds-and-overlays-in-swiftui/ | Last Update : Mon, 15 Aug 22