Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does React Native styles support gradients?

Tags:

react-native

I see that someone made this for it: https://github.com/brentvatne/react-native-linear-gradient

But is there support for it in RN itself? Something like

style = StyleSheet.create({     backgroundGradient: "vertical",     backgroundGradientTop: "#333333",     backgroundGradientBottom: "#666666" }); 
like image 223
Some Guy Avatar asked Aug 15 '15 18:08

Some Guy


People also ask

How do you add gradients in react?

To add a linear-gradient background in a React component, we can put the linear-gradient value in the style prop object. to set the background property to "linear-gradient(#e66465, #9198e5)" .


1 Answers

Not at the moment. You should use the library you linked; they recently added Android support and it is by one of the main contributors of react-native.

like image 181
isair Avatar answered Sep 17 '22 04:09

isair