mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
883 B
883 B
nav-title, title, environment, description, previous_url
| nav-title | title | environment | description | previous_url |
|---|---|---|---|---|
| TabView How-To | tab-view | nativescript | Examples for using TabView | /ApiReference/ui/tab-view/HOW-TO |
TabView
Declaring the TabView in xml.
<Page>
<TabView>
<TabView.items>
<TabViewItem title="Tab 1">
<TabViewItem.view>
<Label text="Label in Tab1" />
</TabViewItem.view>
</TabViewItem>
<TabViewItem title="Tab 2">
<TabViewItem.view>
<Label text="Label in Tab2" />
</TabViewItem.view>
</TabViewItem>
</TabView.items>
</TabView>
</Page>
Using a TabView requires the "ui/tab-view" module. {%snippet article-require-tabview-module%}
Binding TabView.items
{%snippet article-binding-tabview-items%}
Selecting a tab programmatically
{%snippet article-select-tab%}
Creating a TabView
{%snippet article-create-tabview%}