如何按百分比显示进度条状态
我正在使用 android 2.3.3 的进度对话框。进度对话框的状态显示格式为“60% 60/100”,但我只想显示百分比而不是“60/100”。我该怎么做呢?请帮忙。
I am using progress dialog for android 2.3.3. Progress dialog's status is showing with the format as "60% 60/100" but I want to display only percentage not "60/100". How can I do it? please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 文档,您应该在您的
ProgressDialog
实例上调用setProgressNumberFormat (null)
来获取此行为According to documentation, you should call
setProgressNumberFormat (null)
on yourProgressDialog
instance to get this behavior请访问此链接。
SDK 内的 ApiDemos 也对此进行了完整解释。您想要的示例名为:ProgressBar3.java,可以在 \ApiDemos\src\com\example\android\apis\view\ 中找到。
另外,如果您想删除对话框的边框以便只显示进度条您可以将对话框本身定义为透明视图/覆盖(示例中也有解释)。
Please visit this link.
Also It's explained in full in ApiDemos inside the SDK. The example that you want is named: ProgressBar3.java and can be found in \ApiDemos\src\com\example\android\apis\view\
Also, if you want to remove the borders of the dialog so that only the progress bar appears you can define the dialog itself as a transparent view/overlay (it's explained in the examples as well).