0

Was trying to make a snackbar in a transparent Activity and got errors, changed the theme in Manifest to android:theme="@style/Theme.AppCompat" now it works fine... Doesn't look good though. Is there a way to make the avtivity transparent and make the snackbar work?

Thanks in advance!

Ravindra Kushwaha
  • 7,846
  • 14
  • 53
  • 103
Dunoo
  • 39
  • 10

2 Answers2

1

Go to your activity xml file and set the background to transparent

android:background="@android:color/transparent"
Drilon Blakqori
  • 2,796
  • 2
  • 17
  • 25
1

This just change your Theme to Theme.AppCompat and it looks darker.

Refer that android:theme="@style/Theme.AppCompat" to this in your Manifest:

android:theme="@style/AppTheme">

So, do your stuffs in values -> Styles.xml.

Here is the Styles after that changes, you can customize that activity here too:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->

    </style>

</resources>

And about that Transparent, like i said you should use something like these stuffs:

in your Layout:

android:background="@android:color/transparent"

or:

How to create Transparent Activity in Android?

Community
  • 1
  • 1
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108