MaterialActiveAppearance
The behavior for how materials appear active and inactive.
Declaration
type MaterialActiveAppearance = 'active' | 'automatic' | 'matchWindow';struct MaterialActiveAppearancePass a literal, or build one with SwiftUI.MaterialActiveAppearance from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'active'SwiftUI.MaterialActiveAppearance.activeMaterials will always appear active.
'automatic'SwiftUI.MaterialActiveAppearance.automaticMaterials will automatically appear active or inactive based on context and platform convention.
'matchWindow'SwiftUI.MaterialActiveAppearance.matchWindowMaterials will have an active or inactive appearance based on the active appearance of their window.
Overview
On macOS, materials have active and inactive appearances that can reinforce the active appearance of the window they are in:
- Materials used as a
windowcontainer background andbarmaterials will appear inactive when their containing window is inactive. - All other materials will always appear active by default.
An explicit active appearance can be set to override a material's default
behavior. For example, materials used as the window container background
can be made to always appear active by setting the active appearance
behavior to be always active:
Text("Hello, World!")
.containerBackground(
Material.regular.materialActiveAppearance(.active),
for: .window)From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Drawing and shapes.
- AngleA geometric angle whose value you access in either radians or degrees.
- AngularGradientAn angular gradient.
- AnyGradientA color gradient.
- BlendModeModes for compositing a view with overlapping content.
- ButtonBorderShapeA shape used to draw a button's border.
- ColorMatrixA matrix to use in an RGBA color transformation.
- ConcentricRectangleAnimatableDataThe type defining the data to animate.
- ContainerRelativeShapeA shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle.
- ContentShapeKindsA kind for the content shape of a view.
- CoordinateSpaceProtocolA frame of reference within the layout system.
- DefaultGlassEffectShapeThe default shape applied by glass effects, a capsule.
- EllipticalGradientA radial gradient that draws an ellipse.