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

Opacity in nested components doesn't work as expected #3183

Closed
JakeRawr opened this issue Oct 1, 2015 · 2 comments

Comments

@JakeRawr
Copy link
Contributor

@JakeRawr JakeRawr commented Oct 1, 2015

I'm trying to set a 0.1 opacity of a black background with a 1 opacity text

<View style={{backgroundColor: 'black', opacity: 0.1, ... }}>
  <Text style={{color: white, opacity: 1, ... }}>{$25}</Text>
</View>

and i got the following:

screen shot 2015-10-01 at 3 12 17 pm

Is this expected?

@ide

This comment has been minimized.

Copy link
Contributor

@ide ide commented Oct 1, 2015

Yes, this is expected. Opacity is multiplied through the view hierarchy. My suggestion for you now is to use an rgba background color, like this: rgba(0, 0, 0, 0.1).

@ide ide closed this Oct 1, 2015
@JakeRawr

This comment has been minimized.

Copy link
Contributor Author

@JakeRawr JakeRawr commented Oct 1, 2015

Thanks

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.