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

后端 未结 6 660
谎友^
谎友^ 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 18:13

    You can also call this function at the end of your VStack (that is inner the List).

    It will be an overlay on List Seperator on iOS 14 :)

    private func hideDefaultListSeperator() -> some View {
        Rectangle()
            .fill(colorScheme == .light ? Color.white : Color.black)
            .frame(maxHeight: 1)
    }
    

提交回复
热议问题