Change progressdialog background

In my Android application, I use the progress dialog in my popup. I would like to see only progress bar with message loading without background. Is there a way to change the background to transparent in Android?

Share your valuable suggestions.

+5
source share
6 answers

The ProgressBar should be placed in the layout, and then you should set or change the progress indicator in your activity.

Beware of setting the background before setting max, min, progress, and text or it will not display correctly.

+1
source

, XML , .

0

MGS, <Progressbar> XML . , ProgressDialog, CustomDialog . Dialog.

0

, . . .

android:background="@android:color/transparent" 

background , .

, .

0

create the layout of the .xml file that you want to display in the dialog box, then create the dialog object

Dialogue dialogue = new dialogue (main.this);

  • dialog.setContentView (. R.layout "your_layout");
  • dialog.setTitle ("This is my custom dialog box");
  • dialog.setCancelable (true);
0
source

Creating a dialog set sets the dialog style as follows:

  <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowIsFloating">false</item>
        <item name="android:windowNoTitle">true</item>
    </style>

For ex:

Dialog dialog = new Dialog(main.this,R.style.CustomDialogTheme);
dialog.setContentView(<layout>);

Just put your progress bar on the layout.

0
source

All Articles