Home > AI > IOS > SwiftUI >

LinearGradient

Example 1:

struct ContentView: View {
    var body: some View {
        Text("Hello World")
            .padding()
            .foregroundColor(.white)
            .background(LinearGradient(gradient: Gradient(colors: [.white, .black]),
                                       startPoint: .top,
                                       endPoint: .bottom))
    }
}

Leave a Reply