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

accessibilityLabel(_:)

Adds a label to the view that describes its contents. ビューにそれの内容を記述するラベルを加えます。

Declaration 宣言

func accessibilityLabel(_ label: Text) -> Text

Parameters パラメータ

label

The text view to add the label to.

Discussion 議論

Use this method to provide an alternative accessibility label to the text that is displayed. For example, you can give an alternate label to a navigation title:


var body: some View {
    NavigationView {
        ContentView()
            .navigationTitle(Text("􀈤").accessibilityLabel("Inbox"))
    }
}

You can’t style the label that you add

See Also 参照

Providing Accessibility Information