How to remove the left and right Padding of a List in SwiftUI?

后端 未结 6 2033
情歌与酒
情歌与酒 2020-12-14 06:21

How to remove the left and right Padding of a List in SwiftUI? Every List i create has borders to the leading and trailing of a cell.

What modifier should I add to r

6条回答
  •  难免孤独
    2020-12-14 06:43

    You should call

    .listRowInsets()

    for row, like this:

    List(items) {
                YoursRowView()
                    .listRowInsets(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
            }
    

提交回复
热议问题