ChangUZ
ChangUZ

Reputation: 5440

How make transparent AppCompat style?

My activity style must be from AppCompat theme.

So I make custom style and set activity style in manifest.

But black background is shown.

Below is custom theme

<style name="TransparentTheme" parent="@style/Theme.AppCompat">

    <item name="android:background">@null</item>
    <item name="background">@null</item>

    <item name="android:windowBackground">@null</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowAnimationStyle">@null</item>
</style>

Upvotes: 9

Views: 9620

Answers (2)

Imtiyaz Khalani
Imtiyaz Khalani

Reputation: 2053

use @android:color/transparent instead of @null

Upvotes: 16

pepe-pa
pepe-pa

Reputation: 552

Use #99000000 in background instead of null

Upvotes: 0

Related Questions