TextTruncationMode

The type of truncation to apply to a line of text when it's too long to fit in the available space.

EnumerationiOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+Text.TruncationMode in SwiftUI

Declaration

React
type TextTruncationMode = 'head' | 'middle' | 'tail';
Swift
enum TruncationMode

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

Type properties

Overview

When a text view contains more text than it's able to display, the view might truncate the text and place an ellipsis (...) at the truncation point. Use the View.truncationMode(_:) modifier with one of the TruncationMode values to indicate which part of the text to truncate, either at the beginning, in the middle, or at the end.

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

Used by

See also

More in Text and symbols.