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

accessibilityShowsLargeContentViewer(_:)

Adds a custom large content view to be shown by the large content viewer.

Declaration 宣言

func accessibilityShowsLargeContentViewer<V>(_ largeContentView: () -> V) -> some View where V : View

Discussion 議論

Rely on the large content viewer only in situations where items must remain small due to unavoidable design constraints. For example, buttons in a tab bar remain small to leave more room for the main app content.

The following example shows how to add a custom large content view:


var body: some View {
    Button(action: newMessage) {
        Image(systemName: "plus")
    }
    .accessibilityShowsLargeContentViewer {
        Label("New Message", systemImage: "plus")
    }
}

Don’t use the large content viewer as a replacement for proper Dynamic Type support. For example, Dynamic Type allows items in a list to grow or shrink vertically to accommodate the user’s preferred font size. Rely on the large content viewer only in situations where items must remain small due to unavoidable design constraints.

For example, views that have their Dynamic Type size constrained with dynamicTypeSize(_:) or dynamicTypeSize(_:) may require a large content view.