Declaration
compose().listSectionSeparator(
visibility: SwiftUI.Visibility,
options?: {
edges?: SwiftUI.VerticalEdgeSet;
}
)nonisolated func listSectionSeparator(
_ visibility: Visibility,
edges: VerticalEdge.Set = .all
) -> some ViewParameters
visibility*SwiftUI.VisibilityThe visibility of this section's separators.
options.edgesSwiftUI.VerticalEdgeSetThe set of row edges for which the preference applies. The list style might already decide to not display separators for some edges. The default is
VerticalEdge.Set.all.
Discussion
Separators can be presented above and below a section. 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 bottom sections separator are hidden:
List {
ForEach(garage) { garage in
Section(header: Text(garage.location)) {
ForEach(garage.cars) { car in
Text(car.model)
.listRowSeparatorTint(car.brandColor)
}
}
.listSectionSeparator(.hidden, edges: .bottom)
}
}
.listStyle(.grouped)To change the visibility and tint color for a row separator, use
View.listRowSeparator(_:edges:) and
View.listRowSeparatorTint(_:edges:).
To set the tint color for a section separator, use
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.
- 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.
- 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.