1

I have this simple project here : https://github.com/bsumanji/firstmobileproject/blob/master/App.js and need a gradient colors in header background. Please help :)

import { LinearGradient } from 'expo-linear-gradient';

const Stack = createStackNavigator();
const standardColor = {
  headerStyle: { backgroundColor: "blue"}
  
};


export default function App() {

  return (

    
    <NavigationContainer>{/* Rest of your app code */}      
       <Stack.Navigator screenOptions ={standardColor}>
          <Stack.Screen name ="Welcome" component={welcomeScreen} />
          <Stack.Screen name ="Home" component={homeScreen} />
       </Stack.Navigator>
       
    </NavigationContainer>

    
  );
}

1 Answer 1

1

Instead of using a library, you can achieve the same thing with CSS linear-gradient() function.

Example:

.className{
background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%);
}

Reference here

Sign up to request clarification or add additional context in comments.

2 Comments

this function is not helping :(
what did you do? can you post a snippet ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.