SwiftUIでListを使うとデフォルトで下線部が出てます。こいつ、消したいです
結論:listRowSeparator を子Viewにつけたら消える!個別設定できる
ひとまずデフォルトはこんな感じ
struct test_listinsets: View {
var body: some View {
List{
listItem()
.listRowSeparator(.hidden) ///← これをつけた
listItem()
listItem()
}
.listStyle(GroupedListStyle())
}
}
struct listItem:View{
var body: some View{
Rectangle()
.frame(maxWidth: .infinity)
.frame(height:200)
.foregroundColor(Color.gray)
}
}
隙間を埋めてくっつけたいとか、そういう話は別の設定があるので以下を参照してたぶんできる