Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix the style of the image. #2

Open
igachmov opened this issue Nov 6, 2020 · 0 comments
Open

How to fix the style of the image. #2

igachmov opened this issue Nov 6, 2020 · 0 comments

Comments

@igachmov
Copy link

igachmov commented Nov 6, 2020

The library is great, but if you want to change the style of the image, you need to add a prop imageStyle to the component and then you need to go to node_modules/react-native-image-gradient/distribution/index.js and add the imageStyle prop to the ImageBackground component. The code should look like this.

  <ImageGradient imageStyle={styles.imageStyle}/>

return _react2.default.createElement(_reactNative.ImageBackground, { imageStyle: this.props.imageStyle, style: mainStyle, source: localImage ? require(imageUrl) : { uri: imageUrl } }, _react2.default.createElement(_reactNativeLinearGradient2.default, {
            style: gradientStyle,
            start: startPosition,
            end: endPosition,
            colors: ['rgba(' + rgbcsvEnd + ',' + opacityEnd + ')', 'rgba(' + rgbcsvStart + ',' + opacityStart + ')']
        }, this.props.children));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant