Unknown padding on list with navigation view SwiftUI IOS 14

92 views Asked by At

I am using list in my view and it displays unknown padding and I don't know why. I already set the padding to 0 but nothing happens.

Image Preview

Main View - Where list located

struct GradeStudentsView: View {
    
    @ObservedObject var viewModel : GradeStudentsViewModel
    
    var body: some View {
        VStack(alignment: .leading, spacing: 0) {
            List {
                VStack {
                    Spacer().frame(height: 10)
                    
                    Text("BOYS")
                        .font(.system(size: 16))
                        .fontWeight(.bold)
                    
                    Spacer().frame(height: 10)
                    
                    ForEach(self.viewModel.maleList, id: \.self) { model in
                        ListItemStudentGrade(model: model)
                    }.listRowInsets(EdgeInsets())
                    
                    Text("GIRLS")
                        .font(.system(size: 16))
                        .fontWeight(.bold)
                    
                    Spacer().frame(height: 10)
                    
                    ForEach(self.viewModel.femaleList, id: \.self) { model in
                        ListItemStudentGrade(model: model)
                    }.listRowInsets(EdgeInsets())
                }
                .background(Color.blue)
            }
        }
    }
}
0

There are 0 answers