How to remove List Separator lines in SwiftUI 2.0 in iOS 14 and above

Here is a demo of possible solution. Tested with Xcode 12b.

demo

List {
    ForEach(0..<3) { _ in
        VStack {
            Text("Hello, World!").padding(.leading)
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
        .listRowInsets(EdgeInsets())
        .background(Color(UIColor.systemBackground)))
    }
}

Leave a Comment