0.1.1 • Published 8 years ago

react-native-tpicker v0.1.1

Weekly downloads
18
License
MIT
Repository
github
Last release
8 years ago

###The React-Native-Picker react native Picker component for both Android and iOS.

###Attention

  • This project has already transfered to react-native-picker-xg, and will not update.
  • For more about this project ,see react-native-picker in the github. ###The environment
  • node v6.1.0
  • npm v3.9.3
  • react v15.0.2
  • react-native v0.26.2

Main

How to install

npm install react-native-tpicker --save

Example

image

Two ways:

* the second one(in this way, *please* make sure the version of the react matches the need of the react-native)
  * download the zip from the [github](https://github.com/lulutia/react-native-tpicker)
  ```
  npm install react --save
  npm install react-native --save
  npm install react-native-vector-icons --save
  
  ```
  * the example has already in the index.android.js and index.ios.js
  
### Properties
* selectIndex: [number] ,initial selected item
* selfStyle: CSS-layout, the innerContainer's style
* inputStyle: CSS-layout, the textInput's style
* confirmBtnText: string, the text of the confirm button
* cancelBtnText: string, the text of the cancel button
* confirmBtnStyle: CSS-layout, the confirm button's style
* cancelBtnStyle: CSS-layout, the cancel button;s style
* enable: bool, to enable or disable the textInput
* inputValue: string, the initial text of the textInput

###Method
* onResult: function, to expose the result you chose.

###Data structure
Basicly, you can realize as more as wheels as you like if you follow the data structure we set for you. However, take the size of the phone into consideration, we do not recommend more than 4 wheels.
* For the basic pickers: It's an array, the count of the wheel depends on how many objects you have. And the content of the wheel depends on the name of one objects of the outer objects. 

let wheel2 = { amc: { name: '2011年', }, alfa: { name: '2012年', }, aston: { name: '2013年', }, audi: { name: '2014年', }, austin: { name: '2015年', }, borgward: { name: '2016年', }, buick: { name: '2017年', }, cadillac: { name: '2018年', }, chevrolet: { name: '2019年', }, }, { amc1: { name: '1月', }, alfa1: { name: '2月', }, aston1: { name: '3月', }, audi1: { name: '4月', }, },

* For the cascade wheels: It'a an object in total, and the keys of one object become the content of the wheel. The last wheel's content is an array.

let level3Data = { "四川":{ "成都":"青羊区","武侯区","温江区", "绵阳":"绵阳中学","核弹基地", "广安":"容县","武胜" }, "浙江":{ "杭州":"西湖","银泰","玉泉", "绍兴":"X1","X2","X3", "place":"Y1","Y2","Y3","Y4","Y5", }, "some":{ "place1":"Z1","Z2","Z3", "place2":"Z4","Z5","Z6","Z7", "place3":"A1","A2","A3","A4","A5","A6", } }

* For more information, you can see the examples.


 
0.1.1

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago