Can anyone guide me how to make background of a snackbar transparent?
Thanks
Can anyone guide me how to make background of a snackbar transparent?
Thanks
Snackbar snackbar = Snackbar.make(mainView, text, Snackbar.LENGTH_LONG);
View snackBarView = snackbar.getView();
snackBarView.setBackgroundColor(context.getResources().getColor(R.color.yourcolor));
snackbar.show();
you can define your color as transparent in values.
For newcomers (Kotlin)
snackbar.view.setBackgroundColor(Color.TRANSPARENT)
It will remove the background from Snackbar