struct LabelStyleConfiguration
The properties of a label.
Availability 有効性
Technology
init(_ configuration: LabelStyleConfiguration
)
Title
is LabelStyleConfiguration.Title
and Icon
is LabelStyleConfiguration.Icon
.configuration
The label style to use.
You can use this initializer within the make
method of a Label
instance to create an instance of the label that’s being styled. This is useful for custom label styles that only wish to modify the current style, as opposed to implementing a brand new style.
For example, the following style adds a red border around the label, but otherwise preserves the current style:
struct RedBorderedLabelStyle: LabelStyle {
func makeBody(configuration: Configuration) -> some View {
Label(configuration)
.border(Color.red)
}
}
struct LabelStyleConfiguration