Add minimumTrackTintColor and maximumTrackTintColor to SliderIOS
Summary: There are still many other props that can be added to further customize the SliderIOS component, but I had a specific need for these two so I just went ahead and added them. Closes https://github.com/facebook/react-native/pull/799 Github Author: Brent Vatne <brent.vatne@madriska.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
parent
621a30c8b8
commit
c219f61818
|
@ -51,6 +51,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.
|
||||
*/
|
||||
|
@ -81,6 +93,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}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -50,5 +50,7 @@ static void RCTSendSliderEvent(RCTSliderManager *self, UISlider *sender, BOOL co
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue