func foregroundStyle <S>(S) -> some View
func foregroundStyle <S1, S2>(S1, S2) -> some View
func foregroundColor (Color?) -> some View
Availability 有効性
Technology
func foregroundStyle<S1, S2, S3>(_ primary: S1, _ secondary: S2, _ tertiary: S3) -> some View
where S1 : ShapeStyle
, S2 : ShapeStyle
, S3 : ShapeStyle
A view that uses the given foreground styles.
primary
The primary color or pattern to use when filling in the foreground elements. To indicate a specific value, use Color
or image(_:
, or one of the gradient types, like linear
. To set a style that’s relative to the containing view’s style, use one of the semantic styles, like primary
.
secondary
The secondary color or pattern to use when filling in the foreground elements.
tertiary
The tertiary color or pattern to use when filling in the foreground elements.
SwiftUI uses these styles when rendering child views that don’t have an explicit rendering style, like images, text, shapes, and so on.
Symbol images within the view hierarchy use the palette
rendering mode when you apply this modifier, if you don’t explicitly specify another mode.
func foregroundStyle <S>(S) -> some View
func foregroundStyle <S1, S2>(S1, S2) -> some View
func foregroundColor (Color?) -> some View