SwiftUI Background Color not Working

Hi. I am making an app with a background image, but that does not take up the full screen on Pro Max iPhones, so I am setting a background color behind the image. Surprisingly, the background color is not showing up. Here is the code of the View:

struct IntroView: View {

    @StateObject var viewRouter: ViewRouter

    var body: some View {

        ZStack {

            Color("AccentColor").edgesIgnoringSafeArea(.all)

            Image("GameStart")

            VStack {

                Text("""

The NS Labs app is a placeholder to not show confidential app name

"""

                ).font(.system(size: 20)).frame(width: UIScreen.screenWidth, height: 250).foregroundColor(Color(.systemBlue))
 Text("""

Welcome to the NS Labs App

""" ).font(.system(size: 20)).frame(width: UIScreen.screenWidth, height: 200).foregroundColor(Color(.systemBlue))

                Text("Click Let’s Go to start using the NS Labs app!").font(.system(size: 20)).frame(width: UIScreen.screenWidth, height: 200).foregroundColor(Color(.systemYellow)).padding(.bottom, 20)

                Button(action: {

                    viewRouter.currentPage = .page2

                }) {

                    Text("Let's Go!").foregroundColor(.white).font(.system(size: 34))
    }.frame(width: 200, height: 70).background(Color.yellow).cornerRadius(12)

            }
        }
    }
}
Answered by NSApps in 692825022

I found the problem, I put it in the wrong view. Silly me 🤪.

Accepted Answer

I found the problem, I put it in the wrong view. Silly me 🤪.

SwiftUI Background Color not Working
 
 
Q