Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

listRowSeparatorTint not updated

This sample code exhibits two issues:

struct ContentView: View
{
	@State private var myColor = Color.red
	var body: some View {
		VStack() {
			List() {
				Text("Object")
				Text("Object")
				Text("Object")
					.listRowSeparatorTint(myColor)
				Text("Object")
			}
			Button(action:{myColor = Color.green})
			{Text("Change color")}
		}
		.foregroundColor(myColor)
	}
}
  1. the row separator isn't redraws when the @State property change
  2. listRowSeparatorTint apply to two lines

The first point is really disappointing. Is there anyone which know if this is a bug or there is a more correct way to use listRowSeparatorTint with changing parameter?

Answered by darkpaw in 832513022

Your first point does look like a bug. You should raise it in the usual way at https://feedbackassistant.apple.com/ then post the FB number here.

To your second point, it looks like it's applying it to two rows, but it isn't. You need to tell it which edges to apply it to. If you don't it applies to all edges by default, so top and bottom.

If you change that line to .listRowSeparatorTint(myColor, edges: .top) you'll see it only applies to the very centre line, i.e.:

Accepted Answer

Your first point does look like a bug. You should raise it in the usual way at https://feedbackassistant.apple.com/ then post the FB number here.

To your second point, it looks like it's applying it to two rows, but it isn't. You need to tell it which edges to apply it to. If you don't it applies to all edges by default, so top and bottom.

If you change that line to .listRowSeparatorTint(myColor, edges: .top) you'll see it only applies to the very centre line, i.e.:

Thank you darkpaw.

The FB id is FB17087890

listRowSeparatorTint not updated
 
 
Q