How to remove the line separators from a List in SwiftUI without using ForEach?

前端 未结 13 1757
盖世英雄少女心
盖世英雄少女心 2021-01-30 04:50

I have this code to display a list of custom rows.

struct ContentView : View {
    var body: some View {
        VStack(alignment: .leading) {
            List(1         


        
13条回答
  •  借酒劲吻你
    2021-01-30 05:32

    Check out SwiftUI-Introspect. It exposes the underlying UIKit/AppKit views.

    iOS 13 builds only:

    In this case you could manipulate the UITableView directly (without having to change all table views via the appearance proxy):

        import Introspect
        :
        :
        List {
            ...
        }.introspectTableView { tableView in
             tableView.separatorStyle = .none
        }
    

提交回复
热议问题