Declaration
compose().listRowSeparatorTint(
color: SwiftUI.Color | null,
options?: {
edges?: SwiftUI.VerticalEdgeSet;
}
)nonisolated func listRowSeparatorTint(
_ color: Color?,
edges: VerticalEdge.Set = .all
) -> some ViewParameters
color*SwiftUI.Color | nullThe color to use to tint the row separators, or
nilto use the default color for the current list style.options.edgesSwiftUI.VerticalEdgeSetThe set of row edges for which the tint applies. The list style might decide to not display certain separators, typically the top edge. The default is
VerticalEdge.Set.all.
Discussion
Separators can be presented above and below a row. You can specify to which edge this preference should apply.
This modifier expresses a preference to the containing List. The list
style is the final arbiter for the separator tint.
The following example shows a simple grouped list whose row separators are tinted based on row-specific data:
List {
ForEach(garage.cars) { car in
Text(car.model)
.listRowSeparatorTint(car.brandColor)
}
}
.listStyle(.grouped)To hide a row separators, use
View.listRowSeparator(_:edges:).
To hide or change the tint color for a section separator, use
View.listSectionSeparator(_:edges:) and
View.listSectionSeparatorTint(_:edges:).
See also
More in Lists and tables.
- deleteDisabledAdds a condition for whether the view's view hierarchy is deletable.
- listItemTintSets the tint effect for content in a list.
- listRowBackgroundPlaces a custom background view behind a list row item.
- listRowInsetsSets the insets of rows in a list on the specified edges.
- listRowSeparatorSets the display mode for the separator associated with this specific row.
- listRowSpacingSets the vertical spacing between two adjacent rows in a List.
- listSectionIndexVisibilityChanges the visibility of the list section index.
- listSectionMarginsSet the section margins for the specific edges.
- listSectionSeparatorSets whether to hide the separator associated with a list section.
- listSectionSeparatorTintSets the tint color associated with a section.
- listSectionSpacingSets the spacing between adjacent sections in a List to a custom value.
- moveDisabledAdds a condition for whether the view's view hierarchy is movable.