0

I am trying to get the entire background of this view to be black while still showing the list.

struct SavedPasswordsView: View {
    @Binding var savedPasswords: [String]

    var body: some View {
        NavigationView {
            List {
                ForEach(savedPasswords, id: \.self) { password in
                    Text(password)
                        .foregroundColor(.orange)
                }
                .onDelete(perform: deletePassword)
            }
            .listStyle(DefaultListStyle())
            .navigationBarTitle("Saved Passwords")
            .navigationBarTitleDisplayMode(.inline)
            .background(Color.black) // Set the background color of the NavigationView
        }
        .navigationViewStyle(StackNavigationViewStyle())
        .foregroundColor(.orange)
    }

I went ahead and tried adjusting the background as usual and if I do use Color.black.edgesIgnoringSafeArea(.all) it makes it black but won't display the list.

HangarRash
  • 7,314
  • 5
  • 5
  • 32
natekdg
  • 1
  • 1

0 Answers0