Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

React Native modal picker for both Android and iOS

NotificationsYou must be signed in to change notification settings

binbytes/react-native-simple-modal-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy to use and fully customized modal picker for both iOS and Android. Have same look and feel in both plateform.

Installation

$ npm install react-native-simple-modal-picker --save

Properties

PropDataTypeDescriptionIsRequired
dataArrayData in json formattrue
valueStringName of field which you want tobe return on selection from arraytrue
labelStringName of field which you want tobe shown in list of selectiontrue
onValueChangefunction(value)Will be called on item selection and get value as a argumenttrue
renderRowfunction(rowData)Custom component for render row and get row data as a argumentfalse

Usage

Here fullexample of package usage

Simple Modal Picker

<Pickerref={instance=>this.simplePicker=instance}data={this.data}label={'name'}value={'value'}onValueChange={(value)=>alert(value+' selected')}/>

Simple

Modal Picker with Custom Row

<Pickerref={instance=>this.customRowPicker=instance}data={this.data}label={'name'}value={'value'}onValueChange={(value)=>alert(value+' selected')}renderRow={(rowData)=><Textstyle={styles.rowStyle}>{rowData.name}</Text>}/>

Custom

DropDown View

<View><Pickerref={instance=>this.dropDownPicker=instance}data={this.data}label={'name'}value={'value'}onValueChange={(value,selectedIndex)=>this.setState({selectedIndex})}/><Viewstyle={styles.subContainer}><TouchableOpacitystyle={styles.dropDownContainer}onPress={()=>this.dropDownPicker.setModalVisible(true)}><Textstyle={styles.dropDownText}>{this.data[this.state.selectedIndex].name}</Text></TouchableOpacity></View></View>

DropDown

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp