I'm try to set a background color on my SwiftUi List, as for my post here: SwiftUI Background List color
I found a solution inserting the following code as init()
init() {
UITableView.appearance().backgroundColor = UIColor.clear
UITableViewCell.appearance().backgroundColor = .clear
}
my issue now is ... as soon I insert a Navigation Link the background color again became white.
how to set the color to .clear to the NavigationView? I have tried to .foregroundColor(.clear) but noting...
what I want is having a nav link working with no white background.. like this
but actually it does like this :
struct ContentView: View {
var dm : DataManager
init(dmi: DataManager) {
self.dm = dmi
UITableView.appearance().backgroundColor = UIColor.clear
UITableViewCell.appearance().backgroundColor = .clear
}
var body: some View {
ZStack{
RadialGradient(gradient: Gradient(colors: [.orange, .red]), center: .center, startRadius: 100, endRadius: 470).edgesIgnoringSafeArea(.all)
.overlay(
// NavigationView{
List{
ForEach(dm.vector, id: \.self) { item in
Text(String(item))
}
}
// }
)
}
}
}