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

Gradient support for the background #18

Open
Definence opened this issue Dec 15, 2020 · 1 comment
Open

Gradient support for the background #18

Definence opened this issue Dec 15, 2020 · 1 comment

Comments

@Definence
Copy link

Definence commented Dec 15, 2020

Hi, there.
Can you please add gradient support for the background? It would be very helpful. Thanks

@ArthurAssuncao
Copy link

You can use customComponent and height/width 100%. Example below:

In app.jsx

import { heightPercentageToDP, widthPercentageToDP } from 'react-native-responsive-screen';

<AnimatedSplash
        translucent={true}
        isLoaded={isLoaded}
        backgroundColor={#f0f0f0}
        logoHeight={heightPercentageToDP(100)}
        logoWidth={widthPercentageToDP(100)}
        customComponent={<SplashScreenLogo />}>
    <App />
</AnimatedSplash>

In SplashScreenLogo.jsx

import LinearGradient from 'react-native-linear-gradient';

<LinearGradient>
      <View
        style={styles.container}
        {...props}>
        <Image
          accessibilityIgnoresInvertColors={false}
          source={require('../../assets/images/icon-white.png')}
          style={styles.logo}
        />
      </View>
</LinearGradient>

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

2 participants