https://kotlinlang.org logo
#compose
Title
# compose
p

Peter Mandeljc

07/14/2021, 12:37 PM
Anyone had problems, when setting transparent background to Snackbar?
l

Luis

07/14/2021, 12:48 PM
That seems to be the shadow drawn by the elevation property. Have you tried setting the elevation to 0?
👍 1
p

Peter Mandeljc

07/14/2021, 12:48 PM
yeah, just wanted to write that 🙂
works with 0 elevation
k

Kirill Grouchnikov

07/14/2021, 1:42 PM
Elevation doesn't work well with translucent surfaces
3
a

alorma

07/14/2021, 1:54 PM
Good solution is to use your color with alpha composed over surface color:
MaterialTheme.colors.onSurface.copy(alpha = 0.12f).compositeOver(color = MaterialTheme.colors.surface)
This way you get the same effect of alpha color but you can have elevation
🍺 1
It works on cards etc...