$ npm install alopeyk-picker --save
$ react-native link alopeyk-picker
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.alopeyk.nativemodule.RNPickerPackage;
to the imports at the top of the file - Add
new RNPickerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':alopeyk-picker' project(':alopeyk-picker').projectDir = new File(rootProject.projectDir, '../node_modules/alopeyk-picker/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':alopeyk-picker')
import {PickerView, DatePickerView} from 'alopeyk-picker';
// TODO: What to do with the module?
<PickerView .../>
<DatePickerView .../>
Props | Type | is Required |
---|---|---|
onSelectedItemChanged |
'func' |
- |
selectedItem |
'number' |
- |
textSize |
'number' |
- |
cyclic |
'bool' |
- |
textColor |
'string' |
- |
backgroundColor |
'string' |
- |
items |
'array' |
True |
itemHeight |
'number' |
- |
Props | Type | is Required |
---|---|---|
onSelectedItemChanged |
'func' |
- |
selectedDate |
'Date' 'number' |
- |
startDate |
'Date' 'number' |
- |
endDate |
'Date' 'number' |
- |
textSize |
'number' |
- |
textColor |
'string' |
- |
backgroundColor |
'string' |
- |
itemHeight |
'number' |
- |