diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index 12bbc2cc13488f..93a429cbe43773 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -18,6 +18,7 @@ var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); var TextStylePropTypes = require('TextStylePropTypes'); var View = require('View'); +var processColor = require('processColor'); var itemStylePropType = StyleSheetPropType(TextStylePropTypes); var requireNativeComponent = require('requireNativeComponent'); @@ -48,7 +49,11 @@ var PickerIOS = React.createClass({ if (child.props.value === props.selectedValue) { selectedIndex = index; } - items.push({value: child.props.value, label: child.props.label}); + items.push({ + value: child.props.value, + label: child.props.label, + textColor: processColor(child.props.color), + }); }); return {selectedIndex, items}; }, @@ -95,6 +100,7 @@ PickerIOS.Item = class extends React.Component { static propTypes = { value: React.PropTypes.any, // string or integer basically label: React.PropTypes.string, + color: React.PropTypes.string, }; render() { diff --git a/React/Views/RCTPicker.m b/React/Views/RCTPicker.m index b83a9667cbf078..ce8598b48d4a0b 100644 --- a/React/Views/RCTPicker.m +++ b/React/Views/RCTPicker.m @@ -86,7 +86,9 @@ - (UIView *)pickerView:(UIPickerView *)pickerView } label.font = _font; - label.textColor = _color; + + label.textColor = [RCTConvert UIColor:_items[row][@"textColor"]] ?: _color; + label.textAlignment = _textAlign; label.text = [self pickerView:pickerView titleForRow:row forComponent:component]; return label;