Declaration
compose().listRowSeparator(
visibility: SwiftUI.Visibility,
options?: {
edges?: SwiftUI.VerticalEdgeSet;
}
)nonisolated func listRowSeparator(
_ visibility: Visibility,
edges: VerticalEdge.Set = .all
) -> some ViewParameters
visibility*SwiftUI.VisibilityThe visibility of this row's separators.
options.edgesSwiftUI.VerticalEdgeSetThe set of row edges for which this preference applies. The list style might already decide to not display separators for some edges, 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 of the separator visibility.
The following example shows a simple grouped list whose row separators are hidden:
List {
ForEach(garage.cars) { car in
Text(car.model)
.listRowSeparator(.hidden)
}
}
.listStyle(.grouped)To change the color of a row separators, use
View.listRowSeparatorTint(_:edges:).
To hide or change the tint color for a section separators, 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.
- listRowSeparatorTintSets the tint color associated with a 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.