Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.65 KB

navigation.md

File metadata and controls

59 lines (41 loc) · 1.65 KB

Navigation Views

Contents

Switcher View

This is a very simple view that can be used to toggle between two other views. It can be placed above and below the views being toggled.

Full documentation

SwitcherView(pages: [
    SwitcherPage(label: "One", view: Text("Hello World!")),
    SwitcherPage(label: "Two", view: Text("GoodBye World!"))
])

To place the picker below the views:

SwitcherView(pages: [
    SwitcherPage(label: "One", view: Text("Hello World!")),
    SwitcherPage(label: "Two", view: Text("GoodBye World!"))
])

Tabbed View

This is a view that is intended to anchor a section or the entire application. It adds a bar at the bottom of the screen showing the tabs provided. The view above the bar will change to the view corresponding to the selected tab below.

Full documentation

TabRootView(tabs: [
    TabPage(image: "timer", view: Text("one")),
    TabPage(image: "timer", view: Text("Two")),
    TabPage(image: "timer", view: Text("Three")),
])

You can also provide your own custom theme:

TabRootView(tabs: [
    TabPage(image: "timer", view: Text("one")),
    TabPage(image: "timer", view: Text("Two")),
    TabPage(image: "timer", view: Text("Three")),
], theme: TabViewTheme(backgroundColor: .darkGray, highlightColor: .white, defaultColor: .gray))