Categories
React Native Answers

How to use rgba in React Native?

Spread the love

To use rgba in React Native, we can set it as a style value.

For instance, we write

<View style={{ backgroundColor: "rgba(0,0,0,0.5)" }} />;

to set the backgroundColor style to a rgba value.

The 4th number is a the a value or the opacity.

So the View has 0.5 opacity.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *