TextAlignmentStrategy

The way SwiftUI infers the appropriate text alignment if no value is explicitly provided.

StructureiOS 26.0+macOS 26.0+tvOS 26.0+watchOS 26.0+visionOS 26.0+Text.AlignmentStrategy in SwiftUI

Declaration

React
type TextAlignmentStrategy = 'default' | 'layoutBased' | 'writingDirectionBased';
Swift
struct AlignmentStrategy

Pass a literal, or build one with SwiftUI.TextAlignmentStrategy from import { SwiftUI } from 'swiftui-react-native'.

Type properties

Overview

affects how lines are positioned relative to each other. The text as a whole needs to be positioned at the view level using Alignment.

From Apple’s SwiftUI documentation. Code samples there are Swift.

Used by

See also

More in Layout.