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

前端 未结 13 1787
盖世英雄少女心
盖世英雄少女心 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:29

    Remove paddings and separator

    iOS 14.2, Xcode 12.2

    ScrollView {
        LazyVStack {
            ForEach(viewModel.portfolios) { portfolio in
                PortfolioRow(item: portfolio)
            }
        }
    }
    

    This gives you complete control over the list. Current implementation of List doesn't provide full control and contains some issues.

提交回复
热议问题