How To Add Second ProgressBar Android ProgressDial

2019-08-07 07:57发布

问题:

Friends;

How To Set ProgressDialog Second Progress Bar Like Below Images.

thanx.

回答1:

The screenshot you show is not a ProgressDialog, it is just a Dialog with a custom layout. What you need, in order to show a dialog like the one in your picture is:

  1. A custom layout defining two ProgressBars, one below the other.

  2. Create a Dialog and call yourDialog.setContentView(R.id.yourCustomLayout)

  3. That's it, that's all you need

I would like to call your attention to the fact that you can also show the second progress in the same ProgressBar as the first, by using yourProgressBar.setSecondaryProgress(progressValue).



回答2:

Am I right in assuming that this is a layout issue? You want to have that second progress below the box that it is currently in?

If that's the case, use a relative layout and in the layout xml add this line to the progess bar:

android:layout_below="...."

In the quotation marks enter the id of the box that they are currently in.