StatefulButtonStyle
@MainActor
public struct StatefulButtonStyle : PrimitiveButtonStyle
An object that provides Fiori style color and interaction for Button.
-
Creates a style object that provides fiori style color and interaction for
Button.Declaration
Swift
@MainActor public init(color: Color = .preferredColor(.tintColor), depressedColor: Color = .preferredColor(.tintColorTapState), disabledColor: Color = .gray, isSelectionPersistent: Bool = false)Parameters
colorThe color for normal state.
depressedColorThe color for a depressed button.
disabledColorThe color for a disabled button.
isSelectionPersistentA boolean value determines whether the selection should be persistent or not.
-
Creates a view that represents the body of a button.
The system calls this method for each
Buttoninstance in a view hierarchy where this style is the current button style.Declaration
Swift
@MainActor public func makeBody(configuration: PrimitiveButtonStyle.Configuration) -> some ViewParameters
configurationThe properties of the button.