Declaration
compose().lineSpacing(lineSpacing: number)nonisolated func lineSpacing(_ lineSpacing: CGFloat) -> some ViewParameters
lineSpacing*numberThe amount of space between the bottom of one line and the top of the next line in points.
Discussion
Use lineSpacing(_:) to set the amount of spacing from the bottom of
one line to the top of the next for text elements in the view.
In the Text view in the example below, 10 points separate the bottom
of one line to the top of the next as the text field wraps inside this
view. Applying lineSpacing(_:) to a view hierarchy applies the line
spacing to all text elements contained in the view.
Text("This is a string in a TextField with 10 point spacing applied between the bottom of one line and the top of the next.")
.frame(width: 200, height: 200, alignment: .leading)
.lineSpacing(10)See also
More in Text and symbols.
- allowsTighteningSets whether text in this view can compress the space between characters when necessary to fit text in a line.
- autocorrectionDisabledSets whether to disable autocorrection for this view.
- baselineOffsetSets the vertical offset for the text relative to its baseline in this view.
- boldApplies a bold font weight to the text in this view.
- findDisabledPrevents find and replace operations in a text editor.
- findNavigatorProgrammatically presents the find and replace interface for text editor views.
- fontSets the default font for text in this view.
- fontDesignSets the font design of the text in this view.
- fontWeightSets the font weight of the text in this view.
- fontWidthSets the font width of the text in this view.
- interactionActivityTrackingTagSets a tag that you use for tracking interactivity.
- italicApplies italics to the text in this view.