D
D
Dmitry Sobchuk2021-10-16 17:26:20
Swift
Dmitry Sobchuk, 2021-10-16 17:26:20

Error in xcode "Type 'RoundedRectangle.Type' cannot conform to 'View'"?

import SwiftUI

struct ContentView: View {
    var body: some View {
        HStack {
            CardView ()
            CardView ()
            CardView ()
            CardView ()
            CardView ()
      
        }
            .padding(.horizontal)
            .foregroundColor(/*@[email protected]*/.red/*@[email protected]*/)
    }
}
    struct CardView: View {
        var body: some View {
            ZStack {
            RoundedRectangle(cornerRadius:20).stroke(lineWidth:3)
            Text("Hello, world")
        }
     }
}

616ae10ad9ddc477467258.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question