1.0.11 • Published 2 years ago

react-native-easy-item-picker v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-easy-item-picker

A simple React Native module purely written in javascript that allows you to show a PickerView to select an item from a list of options for both Android and iOS.

alt text

Getting started

$ npm install react-native-easy-item-picker --save

Mostly automatic installation

$ react-native link react-native-easy-item-picker

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-easy-item-picker and add RNItemPicker.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNItemPicker.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNItemPickerPackage; to the imports at the top of the file
  • Add new RNItemPickerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-easy-item-picker'
    project(':react-native-easy-item-picker').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-easy-item-picker/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-easy-item-picker')

Usage

import MyPicker from 'react-native-easy-item-picker'

const mOptions = [
    { key: "Option No 1", value: "opt1" },
    { key: "Option No 2", value: "opt2" },
    { key: "Option No 3", value: "opt3" },
]

	<MyPicker
        title={"Select a link"}
        noSelectionTxt={"Select a link"}

        selectedColor={"#000"}
        unSelectedColor={"#999"}
        arrowColor={"#000"}
        itemTxtColor={"#000"}
        txtFontFamily={{ fontFamily: /*FONT_NAME*/ }}

        titleStyle={{ color: "#000" }}
        bgContainerStyle={{ marginVertical: 20 }}

    	options={mOptions}
        onSelectChange={(item) => { console.log(item) }}
    />
1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago