diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 7556e9c71..fb8d1452c 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -141,6 +141,18 @@ var ScrollView = React.createClass({ * instead of vertically in a column. The default value is false. */ horizontal: PropTypes.bool, + /** + * The style of the scroll indicators. + * - `default` (the default), same as `black`. + * - `black`, scroll indicator is black. This style is good against a white content background. + * - `white`, scroll indicator is white. This style is good against a black content background. + * @platform ios + */ + indicatorStyle: PropTypes.oneOf([ + 'default', // default + 'black', + 'white', + ]), /** * When true, the ScrollView will try to lock to only vertical or horizontal * scrolling while dragging. The default value is false. @@ -524,6 +536,7 @@ var validAttributes = { contentOffset: {diff: pointsDiffer}, decelerationRate: true, horizontal: true, + indicatorStyle: true, keyboardDismissMode: true, keyboardShouldPersistTaps: true, maximumZoomScale: true, diff --git a/React/Views/RCTScrollView.m b/React/Views/RCTScrollView.m index de9bcb273..c69aabb19 100644 --- a/React/Views/RCTScrollView.m +++ b/React/Views/RCTScrollView.m @@ -838,6 +838,7 @@ RCT_SET_AND_PRESERVE_OFFSET(setBouncesZoom, BOOL) RCT_SET_AND_PRESERVE_OFFSET(setCanCancelContentTouches, BOOL) RCT_SET_AND_PRESERVE_OFFSET(setDecelerationRate, CGFloat) RCT_SET_AND_PRESERVE_OFFSET(setDirectionalLockEnabled, BOOL) +RCT_SET_AND_PRESERVE_OFFSET(setIndicatorStyle, UIScrollViewIndicatorStyle) RCT_SET_AND_PRESERVE_OFFSET(setKeyboardDismissMode, UIScrollViewKeyboardDismissMode) RCT_SET_AND_PRESERVE_OFFSET(setMaximumZoomScale, CGFloat) RCT_SET_AND_PRESERVE_OFFSET(setMinimumZoomScale, CGFloat) diff --git a/React/Views/RCTScrollViewManager.m b/React/Views/RCTScrollViewManager.m index 549bc1fac..2d48c0cb6 100644 --- a/React/Views/RCTScrollViewManager.m +++ b/React/Views/RCTScrollViewManager.m @@ -29,6 +29,12 @@ RCT_ENUM_CONVERTER(UIScrollViewKeyboardDismissMode, (@{ @"onDrag": @(UIScrollViewKeyboardDismissModeOnDrag), }), UIScrollViewKeyboardDismissModeNone, integerValue) +RCT_ENUM_CONVERTER(UIScrollViewIndicatorStyle, (@{ + @"default": @(UIScrollViewIndicatorStyleDefault), + @"black": @(UIScrollViewIndicatorStyleBlack), + @"white": @(UIScrollViewIndicatorStyleWhite), +}), UIScrollViewIndicatorStyleDefault, integerValue) + @end @implementation RCTScrollViewManager @@ -49,6 +55,7 @@ RCT_EXPORT_VIEW_PROPERTY(centerContent, BOOL) RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL) RCT_EXPORT_VIEW_PROPERTY(decelerationRate, CGFloat) RCT_EXPORT_VIEW_PROPERTY(directionalLockEnabled, BOOL) +RCT_EXPORT_VIEW_PROPERTY(indicatorStyle, UIScrollViewIndicatorStyle) RCT_EXPORT_VIEW_PROPERTY(keyboardDismissMode, UIScrollViewKeyboardDismissMode) RCT_EXPORT_VIEW_PROPERTY(maximumZoomScale, CGFloat) RCT_EXPORT_VIEW_PROPERTY(minimumZoomScale, CGFloat)