flipsForRightToLeftLayoutDirection(_:)
Sets whether this view mirrors its contents horizontally when the layout direction is right-to-left.
Declaration
nonisolated func flipsForRightToLeftLayoutDirection(_ enabled: Bool) -> some View
Parameters
- enabled:
A Boolean value that indicates whether this view should have its content flipped horizontally when the layout direction is right-to-left. By default, views will adjust their layouts automatically in a right-to-left context and do not need to be mirrored.
Return Value
A view that conditionally mirrors its contents horizontally when the layout direction is right-to-left.
Discussion
Use flipsForRightToLeftLayoutDirection(_:) when you need the system to horizontally mirror the contents of the view when presented in a right-to-left layout.
To override the layout direction for a specific view, use the environment(_:_:) view modifier to explicitly override the layoutDirection environment value for the view.