1

I have refered here. But I just see a black background. Then I use a Android standard Theme "ThemeTranslucentNoTitleBar". It is still a black background. So how to make a activity completely transparent?

protected override void OnCreate(Bundle bundle)
    {
        SetTheme(Android.Resource.Style.ThemeTranslucentNoTitleBar);
        base.OnCreate(bundle);
        SetContentView(Resource.Layout.xxx);
    }
Community
  • 1
  • 1
RyanWang
  • 178
  • 9

1 Answers1

2

After trying lots of times. I find the resolution. You also have to set Android application theme. For exmaple <application android:theme="@android:style/Theme.Translucent" /> If you are using a custom application theme. Do not forget to set android:windowIsTranslucent = true
<style name="CustomTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/CustomActionBar</item> <item name="android:actionMenuTextColor">@color/actionbar_text</item> <item name="android:windowIsTranslucent">true</item> </style>

RyanWang
  • 178
  • 9