I am making an attempt to take away the default padding prime and backside added by the listing in SwiftUi. I’ve an inventory that reveals the duties to be accomplished. Padding prime and backside is added by default when i created the listing and I attempted utilizing ” .listRowInsets(EdgeInsets())” to take away the padding prime and backside of the listing. However failed. I am making an attempt to repair this difficulty from previous 2 days by making an attempt different methods, however I am unable to repair it. The padding prime and backside appears to be like like When just one job is current and this area (white area on the backside) after the listing is regardless of what number of duties are added to the listing and displayed, it has the identical padding backside and prime, even when there are 2 duties current.When 2 duties are current.I wish to take away the highest and backside padding that’s created by the listing. I consider that the padding is as a result of listing. I wish to use listing right here however I additionally wish to take away the padding backside and prime created by the listing. (The padding decreases as I add issues to favourites and the padding will increase when i take away issues from favourites(that’s current after the listing on the backside) due to the listing used. If I take away the listing, all works effective). I would like the padding prime and backside of the listing to be eliminated.May you please recommend what could be executed to beat this downside?
struct TaskView: View {
@State non-public var selectedItem: activityItem?
var physique: some View {
VStack(alignment: .main, spacing: 0) {
Textual content("TASK LIST")
.font(.caption)
.foregroundColor(.grey)
.padding(.main, 40)
.padding(.prime, 15)
.padding(.backside, 5)
VStack(alignment: .main, spacing: 0) {
HStack {
VStack(alignment: .main) {
Textual content("Complete")
.font(.title3)
.foregroundColor(.black)
Textual content("5")
.font(.title3)
.fontWeight(.daring)
}
Spacer()
VStack(alignment: .main) {
Textual content("TASK COMPLETED")
.font(.title3)
.foregroundColor(.black)
Textual content("3")
.font(.title3)
.fontWeight(.daring)
}
}
.padding(.prime, 5)
.padding(.backside, 0)
.padding(.main, 16)
.padding(.trailing, 16)
if !activityInfo.isEmpty {
Divider()
.body(top: 1)
.background(Coloration.grey)
.padding(.prime, 0)
.padding(.horizontal, 25)
Listing {
ForEach(activityInfo) { merchandise in
HStack
{
VStack(alignment: .main) {
Textual content("Task1")
.font(.title2)
.fontWeight(.daring)
Textual content("3 to 4")
.font(.subheadline)
.foregroundColor(.grey)
}
Spacer()
VStack(alignment: .trailing) {
Textual content("Dance")
HStack {
Textual content("Monday")
}
}
}
.listRowInsets(EdgeInsets())
.padding(.horizontal, 5)
.padding(.vertical, 0)
.onTapGesture {
self.selectedItem = merchandise
}
}
.onMove(carry out: transfer)
}
.scrollContentBackground(.hidden)
.background(Coloration.clear.edgesIgnoringSafeArea(.all))
}
}
.background(Coloration.white)
.cornerRadius(10)
.padding(.horizontal)
}
}
func transfer(supply: IndexSet, vacation spot: Int) {
activityInfo.transfer(fromOffsets: supply, toOffset: vacation spot)
}
}
I’ve talked about in black(House take away textual content), the additional area that must be eliminated on the backside and that i even need the highest padding to be eliminated.the area that’s marked as “House Take away” must be eliminated. I am utilizing Xcode 15