Trying out the new Design Support Library, I added a snackbar; but unlike its main background, the text area is not colored with the default value of #323232
. Instead, it looks like this. It seems to take its color from the android:background
value defined in the custom theme in my styles.xml
, which goes like this:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
<item name="android:background">#4f4f5e</item>
...
</style>
If I try to forcefully color it with
View snackbarView = snackbar.getView();
snackbarView.setBackgroundColor(Color.YELLOW);
it only impacts the main background, like this, and the text background still gets colored by the custom theme. Is there a way to both keep my custom theme, and have a standard snackbar? Thanks!
I also faced similar issue & unfortunately no solution works for me Hence I write my own solution where I set background color for parent view too.