[SliderIOS] Add minimumTrackTintColor and maximumTrackTintColor to SliderIOS #799

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+18 −0
Diff settings

Always

Just for now

@@ -54,6 +54,18 @@ var SliderIOS = React.createClass({
*/
maximumValue: PropTypes.number,
+ /**
+ * The color used for the track to the left of the button. Overrides the
+ * default blue gradient image.
+ */
+ minimumTrackTintColor: PropTypes.string,
+
+ /**
+ * The color used for the track to the right of the button. Overrides the
+ * default blue gradient image.
+ */
+ maximumTrackTintColor: PropTypes.string,
+
/**
* Callback continuously called while the user is dragging the slider.
*/
@@ -84,6 +96,8 @@ var SliderIOS = React.createClass({
value={this.props.value}
maximumValue={this.props.maximumValue}
minimumValue={this.props.minimumValue}
+ minimumTrackTintColor={this.props.minimumTrackTintColor}
+ maximumTrackTintColor={this.props.maximumTrackTintColor}
onChange={this._onValueChange}
/>
);
@@ -101,6 +115,8 @@ var validAttributes = {
value: true,
minimumValue: true,
maximumValue: true,
+ minimumTrackTintColor: true,
+ maximumTrackTintColor: true,
};
var RCTSlider = createReactIOSNativeComponentClass({
@@ -50,5 +50,7 @@ - (void)sliderTouchEnd:(UISlider *)sender
RCT_EXPORT_VIEW_PROPERTY(value, float);
RCT_EXPORT_VIEW_PROPERTY(minimumValue, float);
RCT_EXPORT_VIEW_PROPERTY(maximumValue, float);
+RCT_EXPORT_VIEW_PROPERTY(minimumTrackTintColor, UIColor);
+RCT_EXPORT_VIEW_PROPERTY(maximumTrackTintColor, UIColor);
@end