I have a simple SwiftUI
list that displays numbers asynchronously from a Combine
publisher, when I add a View
at the top of the list to ac
The fix is to use explicit list rows inset, something like as below...
List {
VStack {
Rectangle()
Text("Some Text")
Text("Some Other Very Long Text Some Other Some Other Long Text")
}
.background(Color.red)
.listRowInsets(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10)
ForEach(viewModel.items, id: \.self) { item in
Text("\(item)")
}
.listRowInsets(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10)
}