问题
If you set android:windowTranslucentNavigation
to true
in your theme in Lollipop the navigation bar won't be fully translucent like in KitKat. Instead it's a dark semi-transparant background. Does anyone here know what the alpha value is of that background?
回答1:
I've made some test with navigation bar and found that alpha of navBar when android:windowTranslucentNavigation = true
is 40% of black color.
So color in hex would be: #66000000
Here is steps how I calculated this value:
- I made screenshot as presented below
- Then I open it in Gimp image editor and take RGB values of each color
- White is (255,255,255), white under navBar (153,153,153)
- Grey is (150,150,150), grey under navBar (90,90,90)
Then I calculate as next: 255 is 100% 153 is x x = 153 * 100 / 255 = 60%
So I calculated invert value of alpha channel, the true value of alpha channel is 100 - 60 = 40%
ARGB value of 40% is (102,0,0,0)
in hex it's #66000000
来源:https://stackoverflow.com/questions/33466295/default-alpha-value-of-navigation-bar-in-lollipop