Skip to content

Commit 034044e

Browse files
committed
add style for picker
1 parent 90451c3 commit 034044e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Needs react-native >= 0.14.2
2222
###Documentation
2323

2424
####Props
25+
- <b>style</b> style of picker
2526
- <b>pickerBtnText</b> string, tool bar's confirm btn text
2627
- <b>pickerCancelBtnText</b> string, tool bar's cancel ben text
2728
- <b>pickerBtnStyle</b> textStylePropType, tool bar's btn style

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export default class PickerAny extends React.Component {
7070
_getStateFromProps(props){
7171
//the pickedValue must looks like [wheelone's, wheeltwo's, ...]
7272
//this.state.selectedValue may be the result of the first pickerWheel
73+
let style = props.style;
7374
let pickerBtnText = props.pickerBtnText;
7475
let pickerCancelBtnText = props.pickerCancelBtnText;
7576
let pickerBtnStyle = props.pickerBtnStyle;
@@ -116,6 +117,7 @@ export default class PickerAny extends React.Component {
116117
this.pickedValue = JSON.parse(JSON.stringify(selectedValue));
117118
this.pickerStyle = pickerStyle;
118119
return {
120+
style,
119121
pickerBtnText,
120122
pickerCancelBtnText,
121123
pickerBtnStyle,
@@ -458,7 +460,7 @@ export default class PickerAny extends React.Component {
458460
<Animated.View style={[styles.picker, {
459461
height: this.state.pickerHeight,
460462
bottom: this.state.slideAnim
461-
}]}>
463+
}, this.state.style]}>
462464
<View style={[styles.pickerToolbar, this.state.pickerToolBarStyle]}>
463465
<View style={styles.pickerCancelBtn}>
464466
<Text style={[styles.pickerFinishBtnText, this.state.pickerBtnStyle]}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-picker",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "react-native-picker",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)