Hi all, I'm working on a SwiftUI app (macOS only) that uses a Table to show contents of a directory. Each Table Cell seems to have a padding / gap which I would like to remove. If you look at the picture, I want the red rectangle to fill the whole cell. Does anybody know how to achieve this?
Here's my current code for that column:
TableColumn("name", value: \.name) { item in
HStack {
if item.type == .directory {
Image(systemName: "folder")
.frame(width: 14)
} else {
Text("")
.frame(width: 14)
}
Text(item.name)
Spacer()
}
.contentShape(Rectangle())
.gesture(TapGesture(count: 2).onEnded {
print(item)
doubleClick(path: item.path)
}).simultaneousGesture(TapGesture().onEnded {
self.selectedFileItem = item.id
})
.background(.red)
.padding(.all, 0)
}
I want this to be applied to all columns in the table. I only showed one column as a reference. The table style is
.tableStyle(.bordered(alternatesRowBackgrounds: true))