mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:33:20 +08:00
861 B
861 B
nav-title | title | environment | description | previous_url |
---|---|---|---|---|
SegmentedBar How-To | segmented-bar | nativescript | Examples for using SegmentedBar | /ApiReference/ui/segmented-bar/HOW-TO |
SegmentedBar
Using a SegmentedBar requires the "ui/segmented-bar" module. {%snippet article-require-segmentedbar-module%}
Creating a SegmentedBar
{%snippet article-create-segmentedbar%}
<SegmentedBar>
<SegmentedBar.items>
<SegmentedBarItem title="Item 1" />
<SegmentedBarItem title="Item 2" />
<SegmentedBarItem title="Item 3" />
</SegmentedBar.items>
</SegmentedBar>
Creating segmentedBar.items
It is important that an items array gets created and filled with items first and then assigned to the segmented bar. {%snippet article-creating-segmentedbar-items%}
Selecting an item programmatically
{%snippet artcile-selecting-item%}