m3roving
m3roving

Reputation: 12

Mixing Android style: Transparent and Fullscreen

Anybody made this successfully? I'm trying connect two styles to get fullscreen activity with transparent background... Unfortunately it's not so easy as should be. Any idea?

Upvotes: 0

Views: 3367

Answers (1)

ErikR
ErikR

Reputation: 1042

If by "transparent" you mean an activity that has no background (i.e. see through to the home screen), set the activity's theme to "translucent" in the androidmanifest file:

android:theme="@android:style/Theme.Translucent"

You can also set the theme in the activity's OnCreate method right before inflating the layout: setTheme(android.R.style.Theme_Translucent_NoTitleBar);

To make the activity less transparent, set its layout's background to a repeating 1x1 PNG image with alpha channel transparency. color to a hex value with alpha channel value between 00 and FF.

Upvotes: 3

Related Questions