React NativeScript

React NativeScript

  • Docs

›ELEMENTS: COMPONENTS

INTRODUCTION

  • Introduction

GETTING STARTED

  • Quick Start
  • Environment Setup
  • Using React Devtools

CORE CONCEPTS

  • Native Access
  • Navigation
  • Node Roles
  • Modals
  • Plugins
  • Styling

SAMPLES

  • Apps

ELEMENTS: LAYOUT

  • AbsoluteLayout
  • DockLayout
  • FlexboxLayout
  • GridLayout
  • StackLayout
  • WrapLayout

ELEMENTS: COMPONENTS

  • ActivityIndicator
  • ActionBar
  • ActionItem
  • Button
  • DatePicker
  • Frame
  • HtmlView
  • Image
  • Label
  • ListView
  • ListPicker
  • NavigationButton
  • Page
  • Placeholder
  • Progress
  • ScrollView
  • SearchBar
  • SegmentedBar
  • Slider
  • Switch
  • TabView
  • TabViewItem
  • TextField
  • TextView
  • TimePicker
  • WebView

LICENCES

  • Licences
Edit

ListPicker

<listPicker> is a UI component that lets the user select a value from a pre-configured list.

See also:

  • Official top-level documentation
  • Detailed API specification

import * as React from "react";
import { EventData, ListPicker } from "@nativescript/core";

<listPicker
  items={listOfItems}
  selectedIndex={0}
  onSelectedIndexChange={(args: EventData) => {
    const listPicker: ListPicker = args.object as ListPicker;
    const index: number = listPicker.selectedIndex;
    const item = listPicker.items[index];
  }}
/>

Props

NameTypeDescription
itemsArray<string>Gets or sets the items displayed as options in the list picker.
selectedIndexnumberGets or sets the index of the currently selected item.
onSelectedIndexChange(args:EventData) => voidEmitted when the selected time changes. The new index can be retrieved via args.object.selectedIndex.

Native component

AndroidiOS
android.widget.NumberPickerUIPickerView
Last updated by Jamie Birch
← ListViewNavigationButton →
  • Props
  • Native component
React NativeScript
Docs
Getting StartedUI Components Reference
Community
Stack OverflowChat on Slack in #reactTwitter
More
GitHub – React NativeScriptGitHub – Docs Site
Follow @LinguaBrowse
Copyright © 2021 Jamie Birch