Structure

NavigationView

A view for presenting a stack of views that represents a visible path in a navigation hierarchy.

Declaration 宣言

struct NavigationView<Content> where Content : View

Overview 概要

Use a NavigationView to create a navigation-based app in which the user can traverse a collection of views. Users navigate to a destination view by selecting a NavigationLink that you provide. On iPadOS and macOS, the destination content appears in the next column. Other platforms push a new view onto the stack, and enable removing items from the stack with platform-specific controls, like a Back button or a swipe gesture.

A diagram showing a multicolumn navigation view on

Use the init(content:) initializer to create a navigation view that directly associates navigation links and their destination views:


NavigationView {
    List(model.notes) { note in
        NavigationLink(note.title, destination: NoteEditor(id: note.id))
    }
    Text("Select a Note")
}

Style a navigation view by modifying it with the navigationViewStyle(_:) view modifier. Use other modifiers, like navigationTitle(_:), on views presented by the navigation view to customize the navigation interface for the presented view.

Topics 話題

Creating a Navigation View ナビゲーション(誘導)ビューを作成する

Styling Navigation Views

Adding Titles

Managing Navigation Bars

Supporting Types 支援を行う型

Default Implementations 省略時実装

Relationships 関係

Conforms To 次に準拠

See Also 参照

Navigation