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

后端 未结 6 732
谎友^
谎友^ 2020-12-15 17:07

So the question is pretty simple and it\'s in the title. I want to remove the line separator in SwiftUI iOS 14. Previously, I was using UITableView().appearance().sep

6条回答
  •  一整个雨季
    2020-12-15 17:48

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

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

提交回复
热议问题