2

Edit:

Answer found Here

Why the background of ProgressDialog doesn't set to the transparent?

I know this question has many duplicates, but i can't seem to find a solution.

I want to make my Dialog Background transparent, But it seems not to be working.

This is my code in xml.

<style name="TransparentProgressDialog" >
       <item name="android:windowFrame">@null</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowTitleStyle">@null</item>
    <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
    <item name="android:backgroundDimEnabled">false</item>
    <item name="android:background">@android:color/transparent</item>
    </style>

And this is the output.

Issues 1: It shows a grey background and Shadow around it. I want only the animation dialog to show.

I've tried using a transparent background image, but still shows the same grey background.

I've also tried using

dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

in my Java code but didn't work still.

Dialog Image

Community
  • 1
  • 1
Tosin Onikute
  • 3,883
  • 6
  • 38
  • 61
  • try my answer [http://stackoverflow.com/questions/21957263/why-the-background-of-progressdialog-doesnt-set-to-the-transparent/21957406#21957406](http://stackoverflow.com/questions/21957263/why-the-background-of-progressdialog-doesnt-set-to-the-transparent/21957406#21957406) – M D May 27 '15 at 12:31
  • 1
    Thanks, It worked. Voted up + – Tosin Onikute May 27 '15 at 12:40
  • Why do i have to setProgressStyle(android.R.style.Widget_ProgressBar_Small); though? Just asking – Tosin Onikute May 27 '15 at 12:41
  • If you want to display `Progress Icon(Middle icon)` in `small(Medium,Large)` size then only – M D May 27 '15 at 12:42

0 Answers0