flipsForRightToLeftLayoutDirection

Sets whether this view mirrors its contents horizontally when the layout direction is right-to-left.

View ModifieriOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+flipsForRightToLeftLayoutDirection(_:) in SwiftUI

Declaration

React
compose().flipsForRightToLeftLayoutDirection(enabled: boolean)
Swift
nonisolated func flipsForRightToLeftLayoutDirection(
    _ enabled: Bool
) -> some View

Parameters

  • enabled*boolean

    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 View.environment(_:_:) view modifier to explicitly override the EnvironmentValues.layoutDirection environment value for the view.

See also

More in Layout.