From 034044eb0af71715919d33d079912bb807fac614 Mon Sep 17 00:00:00 2001 From: xwenliang Date: Wed, 3 Feb 2016 17:23:21 +0800 Subject: [PATCH] add style for picker --- README.md | 1 + index.js | 4 +++- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d452d9..d9e7564 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Needs react-native >= 0.14.2 ###Documentation ####Props +- style style of picker - pickerBtnText string, tool bar's confirm btn text - pickerCancelBtnText string, tool bar's cancel ben text - pickerBtnStyle textStylePropType, tool bar's btn style diff --git a/index.js b/index.js index a535c1f..141bce5 100644 --- a/index.js +++ b/index.js @@ -70,6 +70,7 @@ export default class PickerAny extends React.Component { _getStateFromProps(props){ //the pickedValue must looks like [wheelone's, wheeltwo's, ...] //this.state.selectedValue may be the result of the first pickerWheel + let style = props.style; let pickerBtnText = props.pickerBtnText; let pickerCancelBtnText = props.pickerCancelBtnText; let pickerBtnStyle = props.pickerBtnStyle; @@ -116,6 +117,7 @@ export default class PickerAny extends React.Component { this.pickedValue = JSON.parse(JSON.stringify(selectedValue)); this.pickerStyle = pickerStyle; return { + style, pickerBtnText, pickerCancelBtnText, pickerBtnStyle, @@ -458,7 +460,7 @@ export default class PickerAny extends React.Component { + }, this.state.style]}>