Return Value 戻り値
A view that’s padded by the amount you specify.
Availability 有効性
Technology
A view that’s padded by the amount you specify.
length
The amount, given in points, to pad this view on all edges.
Use this modifier to add padding all the way around a view.
VStack {
Text("Text padded by 10 points on each edge.")
.padding(10)
.border(.gray)
Text("Unpadded text for comparison.")
.border(.yellow)
}
The order in which you apply modifiers matters. あなたが修飾子を適用する順番は重要です。 The example above applies the padding before applying the border to ensure that the border encompasses the padded region:
To independently control the amount of padding for each edge, use padding(_:)
. To pad a select set of edges by the same amount, use padding(_:
.