如何添加第二个进度条 Android ProgressDialog
朋友们;
如何设置 ProgressDialog 第二个进度条,如下图所示。
谢谢。
Friends;
How To Set ProgressDialog Second Progress Bar Like Below Images.
thanx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您显示的屏幕截图不是 ProgressDialog,它只是一个具有自定义布局的对话框。
为了显示如图所示的对话框,您需要的是:
定义两个 ProgressBar 的自定义布局,一个在另一个下面。
创建一个对话框并调用 yourDialog.setContentView(R.id.yourCustomLayout)
就是这样,这就是您所需要的一切
我想提请您注意这样一个事实,您还可以使用以下命令在与第一个进度条相同的 ProgressBar 中显示第二个进度yourProgressBar.setSecondaryProgress(progressValue)。
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:
A custom layout defining two ProgressBars, one below the other.
Create a Dialog and call yourDialog.setContentView(R.id.yourCustomLayout)
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).
我是否正确地假设这是一个布局问题?您想让第二个进度低于当前所在的框吗?
如果是这种情况,请使用相对布局,并在布局 xml 中将此行添加到进度栏:
在引号中输入它们当前所在的框的 id。
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:
In the quotation marks enter the id of the box that they are currently in.