Xamarin C# Android 7.0 on Moto G5 Plus phone, dialog fragment window transparent background rendering error issue

Viewed 123

I have been trying to solve this issue for 2 days now, with no luck.

I have a DialogFragment which I would like to have a transparent window background.

The way I did it is overriding the DialogFragment class' OnResume like below.

public override void OnResume()
    {
        base.OnResume();
        Dialog.Window.SetBackgroundDrawable(new ColorDrawable(new Color(0, 0, 0, 0)));
    }

Here is the screenshot of what it is doing:

Dialog Fragment with transparent window NOTE:

  1. I have tried using a PNG transparent background too, with no luck Dialog.Window.SetBackgroundDrawableResource(Resource.Drawable.transparent);

  2. This issue only happens on Android 7.0 devices. The other phone and tablet running Android 6++ are rendering the tranparency just fine

0 Answers
Related