Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List Row Separator visibility setting not working? Xcode 13

Seems as though the visibility setting for the separators on lists is not working.. anyone know of a simple workaround?

Here is a piece of sample code:

import SwiftUI

struct ContentView: View {
    var listData = ["John", "Mack", "Bush"]
    var body: some View {
        List(listData, id: \.self) { name in
            Text(name)
        }.listRowSeparator(.hidden)
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
like image 327
Sergio Bost Avatar asked Apr 30 '26 09:04

Sergio Bost


1 Answers

Try this

List {
    ForEach(listData, id: \.self) { name in
        Text(name)
            .listRowSeparator(.hidden)
    }
}
like image 82
Raja Kishan Avatar answered May 02 '26 07:05

Raja Kishan