I wanna remove the bakcground of the default list. All of these solution didn't work, it's there any new modifier we can use to remove bakcground color?
I‘ve tried
.scrollContentBackground(.hidden)
.background(Color.red)
and
UITableView.appearance().separatorStyle = .none
UITableView.appearance().backgroundColor = .clear
UITableViewCell.appearance().backgroundColor = .clear
The structure is like this
VStack{
Text("My Task")
.font(.title3).bold()
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
List{
ForEach(realmManager.task, id: \.id){
TaskViewItem(task: $0.title, complete: $0.complete).listRowBackground(Color.clear)
}
} .scrollContentBackground(.hidden)
}.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(hue: 0.086, saturation: 0.141, brightness: 0.972))
the TaskViewItem class
var body: some View {
HStack(spacing: 20){
Image(systemName: !complete ? "circle" : "circle.fill")
Text(task)
}
}