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

badge(_:)

Generates a badge for the view from a localized string key.

Declaration 宣言

func badge(_ key: LocalizedStringKey?) -> some View

Parameters パラメータ

key

An optional string key to display as a badge. Set the value to nil to hide the badge.

Discussion 議論

Badges are only displayed in list rows and tab bars.

Use a badge to convey optional, supplementary information about a view. Keep the contents of the badge as short as possible.

This modifier creates a Text view on your behalf, and treats the localized key similar to init(_:tableName:bundle:comment:). See Text for more information about localizing strings. Textを文字列のローカライズについてのさらなる情報として見てください。

See Also 参照

Badges