Commit ddec3ff0 authored by xwenliang's avatar xwenliang

v0.2.8

parent 473d96a6
...@@ -8,17 +8,23 @@ Needs react-native >= 0.14.2 ...@@ -8,17 +8,23 @@ Needs react-native >= 0.14.2
![ui](./doc/ui.gif) ![ui](./doc/ui.gif)
![ui2](./doc/ui2.jpg)
###Documentation ###Documentation
####Props ####Props
- <b>pickerBtnText</b> string, tool bar's btn text - <b>pickerBtnText</b> string, tool bar's confirm btn text
- <b>pickerCancelBtnText</b> string, tool bar's cancel ben text
- <b>pickerBtnStyle</b> textStylePropType, tool bar's btn style - <b>pickerBtnStyle</b> textStylePropType, tool bar's btn style
- <b>pickerToolBarStyle</b> viewStylePropType, tool bar's style - <b>pickerToolBarStyle</b> viewStylePropType, tool bar's style
- <b>pickerHeight</b> number - <b>pickerHeight</b> number, height of picker
- <b>showDuration</b> number - <b>showDuration</b> number, animation of picker
- <b>pickerTitle</b> string, title of picker
- <b>pickerTitleStyle</b> textStylePropType, style of title
- <b>pickerData</b> array - <b>pickerData</b> array
- <b>selectedValue</b> any - <b>selectedValue</b> any
- <b>onPickerDone</b> function - <b>onPickerDone</b> function
- <b>onPickerCancel</b> function
####Methods ####Methods
- <b>toggle</b> show or hide picker, default to be hiden - <b>toggle</b> show or hide picker, default to be hiden
...@@ -37,7 +43,6 @@ Needs react-native >= 0.14.2 ...@@ -37,7 +43,6 @@ Needs react-native >= 0.14.2
import Picker from 'react-native-picker' import Picker from 'react-native-picker'
<Picker <Picker
ref={picker => {this.picker = picker;}}
pickerHeight={300} pickerHeight={300}
showDuration={300} showDuration={300}
pickerData={}//picker`s value List pickerData={}//picker`s value List
......
doc/ui2.jpg

32.9 KB

...@@ -102,7 +102,7 @@ export default class PickerAny extends React.Component { ...@@ -102,7 +102,7 @@ export default class PickerAny extends React.Component {
secondPickedData = props.selectedValue[1]; secondPickedData = props.selectedValue[1];
cascadeData = this._getCascadeData(pickerData, selectedValue, firstPickedData, secondPickedData, true); cascadeData = this._getCascadeData(pickerData, selectedValue, firstPickedData, secondPickedData, true);
} }
//保存了已经选择到的数据 //save picked data
this.pickedValue = selectedValue; this.pickedValue = selectedValue;
this.pickerStyle = pickerStyle; this.pickerStyle = pickerStyle;
return { return {
...@@ -482,7 +482,8 @@ let styles = StyleSheet.create({ ...@@ -482,7 +482,8 @@ let styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
borderTopWidth: 1, borderTopWidth: 1,
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: '#c3c3c3' borderColor: '#c3c3c3',
alignItems: 'center'
}, },
pickerBtnView: { pickerBtnView: {
flex: 1, flex: 1,
...@@ -503,7 +504,7 @@ let styles = StyleSheet.create({ ...@@ -503,7 +504,7 @@ let styles = StyleSheet.create({
marginLeft: 20 marginLeft: 20
}, },
pickerTitle: { pickerTitle: {
flex: 5, flex: 4,
color: 'black', color: 'black',
textAlign: 'center' textAlign: 'center'
}, },
......
{ {
"name": "react-native-picker", "name": "react-native-picker",
"version": "0.2.7", "version": "0.2.8",
"description": "react-native-picker", "description": "react-native-picker",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment