Commit 034044eb authored by xwenliang's avatar xwenliang

add style for picker

parent 90451c37
...@@ -22,6 +22,7 @@ Needs react-native >= 0.14.2 ...@@ -22,6 +22,7 @@ Needs react-native >= 0.14.2
###Documentation ###Documentation
####Props ####Props
- <b>style</b> style of picker
- <b>pickerBtnText</b> string, tool bar's confirm btn text - <b>pickerBtnText</b> string, tool bar's confirm btn text
- <b>pickerCancelBtnText</b> string, tool bar's cancel ben 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
......
...@@ -70,6 +70,7 @@ export default class PickerAny extends React.Component { ...@@ -70,6 +70,7 @@ export default class PickerAny extends React.Component {
_getStateFromProps(props){ _getStateFromProps(props){
//the pickedValue must looks like [wheelone's, wheeltwo's, ...] //the pickedValue must looks like [wheelone's, wheeltwo's, ...]
//this.state.selectedValue may be the result of the first pickerWheel //this.state.selectedValue may be the result of the first pickerWheel
let style = props.style;
let pickerBtnText = props.pickerBtnText; let pickerBtnText = props.pickerBtnText;
let pickerCancelBtnText = props.pickerCancelBtnText; let pickerCancelBtnText = props.pickerCancelBtnText;
let pickerBtnStyle = props.pickerBtnStyle; let pickerBtnStyle = props.pickerBtnStyle;
...@@ -116,6 +117,7 @@ export default class PickerAny extends React.Component { ...@@ -116,6 +117,7 @@ export default class PickerAny extends React.Component {
this.pickedValue = JSON.parse(JSON.stringify(selectedValue)); this.pickedValue = JSON.parse(JSON.stringify(selectedValue));
this.pickerStyle = pickerStyle; this.pickerStyle = pickerStyle;
return { return {
style,
pickerBtnText, pickerBtnText,
pickerCancelBtnText, pickerCancelBtnText,
pickerBtnStyle, pickerBtnStyle,
...@@ -458,7 +460,7 @@ export default class PickerAny extends React.Component { ...@@ -458,7 +460,7 @@ export default class PickerAny extends React.Component {
<Animated.View style={[styles.picker, { <Animated.View style={[styles.picker, {
height: this.state.pickerHeight, height: this.state.pickerHeight,
bottom: this.state.slideAnim bottom: this.state.slideAnim
}]}> }, this.state.style]}>
<View style={[styles.pickerToolbar, this.state.pickerToolBarStyle]}> <View style={[styles.pickerToolbar, this.state.pickerToolBarStyle]}>
<View style={styles.pickerCancelBtn}> <View style={styles.pickerCancelBtn}>
<Text style={[styles.pickerFinishBtnText, this.state.pickerBtnStyle]} <Text style={[styles.pickerFinishBtnText, this.state.pickerBtnStyle]}
......
{ {
"name": "react-native-picker", "name": "react-native-picker",
"version": "0.4.0", "version": "0.4.1",
"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