mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
added support for overlayColor property for image
Summary: In Android, Fresco's default rounding corners support mode is BITMAP_ONLY which doesn't work in all cases (such as animated GIF's, some scale types, etc.). Specifying the new "overlayColor" property on an Image will cause Fresco to switch to the other rounding corners mode, OVERLAY_COLOR, and will draw rounded corners by overlaying the solid color specified. Fresco's behaviour is explained here: http://frescolib.org/docs/rounded-corners-and-circles.html Closes https://github.com/facebook/react-native/pull/5366 Reviewed By: svcscm Differential Revision: D2854696 Pulled By: mkonicek fb-gh-sync-id: 251701ee8a64acbfc22694e9d4661c40eef75725
This commit is contained in:
committed by
facebook-github-bot-7
parent
099827372d
commit
f68281a0d8
@@ -30,10 +30,31 @@ var ImageStylePropTypes = {
|
||||
borderRadius: ReactPropTypes.number,
|
||||
overflow: ReactPropTypes.oneOf(['visible', 'hidden']),
|
||||
|
||||
// iOS-Specific style to "tint" an image.
|
||||
// It changes the color of all the non-transparent pixels to the tintColor
|
||||
/**
|
||||
* iOS-Specific style to "tint" an image.
|
||||
* Changes the color of all the non-transparent pixels to the tintColor.
|
||||
* @platform ios
|
||||
*/
|
||||
tintColor: ColorPropType,
|
||||
opacity: ReactPropTypes.number,
|
||||
/**
|
||||
* When the image has rounded corners, specifying an overlayColor will
|
||||
* cause the remaining space in the corners to be filled with a solid color.
|
||||
* This is useful in cases which are not supported by the Android
|
||||
* implementation of rounded corners:
|
||||
* - Certain resize modes, such as 'contain'
|
||||
* - Animated GIFs
|
||||
*
|
||||
* A typical way to use this prop is with images displayed on a solid
|
||||
* background and setting the `overlayColor` to the same color
|
||||
* as the background.
|
||||
*
|
||||
* For details of how this works under the hood, see
|
||||
* http://frescolib.org/docs/rounded-corners-and-circles.html
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
overlayColor: ReactPropTypes.string,
|
||||
};
|
||||
|
||||
module.exports = ImageStylePropTypes;
|
||||
|
||||
Reference in New Issue
Block a user