func lineSpacing (CGFloat) -> some View
func multilineTextAlignment (TextAlignment ) -> some View
Availability 有効性
Technology
A view that limits the number of lines that Text
instances display.
あるビュー、それはText
インスタンスが表示する行数を制限します。
number
The line limit. If nil
, no line limit applies.
行限度。nil
ならば、行限度は適用されません。
Use line
to cap the number of lines that an individual text element can display.
The line limit applies to all Text
instances within a hierarchy. For example, an HStack
with multiple pieces of text longer than three lines caps each piece of text to three lines rather than capping the total number of lines across the HStack
.
例えば、3行より長いテキストの断片を複数もつHStack
は、テキストの各断片を3行に制限します、HStack
全体にわたる行の総数を制限するのではなく。
In the example below, the line
operator limits the very long line in the Text
element to the 2 lines that fit within the view’s bounds:
Text("This is a long string that demonstrates the effect of SwiftUI's lineLimit(:_) operator.")
.frame(width: 200, height: 200, alignment: .leading)
.lineLimit(2)
func lineSpacing (CGFloat) -> some View
func multilineTextAlignment (TextAlignment ) -> some View