Style SnackBar in theme app

前端 未结 5 1662
深忆病人
深忆病人 2020-12-01 16:10

I need help. How can I change the design of the text in snackbar in styles app? The change in the code does not interest me. I found the following code. But it is not worki

5条回答
  •  日久生厌
    2020-12-01 16:16

    I digged into Snackbar sources and here's what I found Snackbar background consists of 2 layers: base and overlay, which colors are mixing.

    In order to specify these colors, just add to your Theme 2 parameters:

    colorSurface - background color, default = 0xFFFFFFFF

    colorOnSurface - overlay, default = 0xFF000000

    So in a default case, with applied 0.8 alpha by default, a color we get is 0xFF333333, which is in a middle between white and black.

    Have fun mixing and styling your Snackbar :)

提交回复
热议问题