<ImageBackground> got `imageRef` and `imageStyle` props
Summary: It can be useful when you want to setup `tintColor` for the image or get a reference to call `setNativeProps` then. Reviewed By: ericvicenti Differential Revision: D5158908 fbshipit-source-id: 873c1cae9bd0af711a42016dcc548231e3cf89e7
This commit is contained in:
parent
d41c9d94fd
commit
2e66ac8999
|
@ -42,18 +42,23 @@ const View = require('View');
|
|||
*/
|
||||
class ImageBackground extends React.Component {
|
||||
render() {
|
||||
const {children, style, ...props} = this.props;
|
||||
const {children, style, imageStyle, imageRef, ...props} = this.props;
|
||||
|
||||
return (
|
||||
<View style={style}>
|
||||
<Image
|
||||
{...props}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
}}
|
||||
style={[
|
||||
{
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
},
|
||||
imageStyle,
|
||||
]}
|
||||
ref={imageRef}
|
||||
/>
|
||||
{children}
|
||||
</View>
|
||||
|
|
Loading…
Reference in New Issue