StatefulButtonStyle

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

    public init(color: Color = .preferredColor(.tintColor),
                depressedColor: Color = .preferredColor(.tintColorTapState),
                disabledColor: Color = .gray,
                isSelectionPersistent: Bool = false)

    Parameters

    color

    The color for normal state.

    depressedColor

    The color for a depressed button.

    disabledColor

    The color for a disabled button.

    isSelectionPersistent

    A 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 Button instance in a view hierarchy where this style is the current button style.

    Declaration

    Swift

    public func makeBody(configuration: PrimitiveButtonStyle.Configuration) -> some View

    Parameters

    configuration

    The properties of the button.