Instance Method インスタンスメソッド

buttonStyle(_:)

Sets the style for buttons within this view to a button style with a custom appearance and standard interaction behavior. このビュー内のボタンに対するスタイルを、あつらえの外観と標準相互作用挙動をもつボタンスタイルへと設定します。

Declaration 宣言

func buttonStyle<S>(_ style: S) -> some View where S : ButtonStyle

Discussion 議論

Use this modifier to set a specific style for all button instances within a view:


HStack {
    Button("Sign In", action: signIn)
    Button("Register", action: register)
}
.buttonStyle(.bordered)

See Also 参照

Styling Buttons ボタンのスタイルを指定する