Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 864 Bytes

File metadata and controls

34 lines (29 loc) · 864 Bytes

Adding a Gradeint View

Screenshot 2023-10-10 at 7 06 16 PM

try? it out

import SwiftUI

struct ContentView: View {
    var body: some View {
        Button(action: {}) {
            Text("Press to confirm your flight")
                .padding(20)
                .frame(maxWidth: .infinity)
                .foregroundColor(.white)
        }
        .background(
            RoundedRectangle(cornerRadius: 100)
                .overlay(
                    LinearGradient(colors: [.red, .green, .yellow], startPoint: .leading, endPoint: .trailing)
                )
                .clipShape(
                    RoundedRectangle(cornerRadius: 100)
                )
        )
        .padding(.horizontal, 20)
    }
}

#Preview {
    ContentView()
}