Xamarin C # Android 7.0 on Moto G5 Plus phone, transparent background fragment dialog box

I am trying to solve this problem in 2 days, with no luck.

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

As I did, this is an override of the DialogFragment ' OnResume , as shown below.

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

Here is a screenshot of what he is doing:

Dialog fragment with a transparent window Note:

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

  • This issue only occurs on Android 7.0 devices. Another Android 6 ++ phone and tablet provides ease of transparency

+5
source share

Source: https://habr.com/ru/post/1270725/


All Articles