Apply thumbTintColor to Sliders on iOS (#22177)
Summary: Applies the `thumbTintColor` prop to Sliders on iOS (which has been supported since iOS 5.0). Updates other documentation so that it is not labeled as Android-only, including the RNTester app Pull Request resolved: https://github.com/facebook/react-native/pull/22177 Differential Revision: D13695554 Pulled By: hramos fbshipit-source-id: 250f6574b193a37b3cd237bcf42612c3e91bf813
This commit is contained in:
parent
378892bc0d
commit
c93edb5ffd
|
@ -60,18 +60,9 @@ type IOSProps = $ReadOnly<{|
|
|||
thumbImage?: ?ImageSource,
|
||||
|}>;
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
/**
|
||||
* Color of the foreground switch grip.
|
||||
* @platform android
|
||||
*/
|
||||
thumbTintColor?: ?ColorValue,
|
||||
|}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
...IOSProps,
|
||||
...AndroidProps,
|
||||
|
||||
/**
|
||||
* Used to style and layout the `Slider`. See `StyleSheet.js` and
|
||||
|
@ -117,6 +108,11 @@ type Props = $ReadOnly<{|
|
|||
* Overrides the default blue gradient image on iOS.
|
||||
*/
|
||||
maximumTrackTintColor?: ?ColorValue,
|
||||
/**
|
||||
* The color used to tint the default thumb images on iOS, or the
|
||||
* color of the foreground switch grip on Android.
|
||||
*/
|
||||
thumbTintColor?: ?ColorValue,
|
||||
|
||||
/**
|
||||
* If true the user won't be able to move the slider.
|
||||
|
|
|
@ -124,8 +124,7 @@ exports.examples = [
|
|||
},
|
||||
},
|
||||
{
|
||||
title: 'Custom thumb color',
|
||||
platform: 'android',
|
||||
title: 'Custom thumb tint color',
|
||||
render(): React.Element<any> {
|
||||
return <SliderExample thumbTintColor={'blue'} />;
|
||||
},
|
||||
|
|
|
@ -83,6 +83,7 @@ RCT_EXPORT_VIEW_PROPERTY(minimumTrackTintColor, UIColor);
|
|||
RCT_EXPORT_VIEW_PROPERTY(maximumTrackTintColor, UIColor);
|
||||
RCT_EXPORT_VIEW_PROPERTY(onValueChange, RCTBubblingEventBlock);
|
||||
RCT_EXPORT_VIEW_PROPERTY(onSlidingComplete, RCTBubblingEventBlock);
|
||||
RCT_EXPORT_VIEW_PROPERTY(thumbTintColor, UIColor);
|
||||
RCT_EXPORT_VIEW_PROPERTY(thumbImage, UIImage);
|
||||
RCT_CUSTOM_VIEW_PROPERTY(disabled, BOOL, RCTSlider)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue