如何按百分比显示进度条状态

发布于 2024-12-29 21:26:13 字数 92 浏览 3 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溺渁∝ 2025-01-05 21:26:13

根据 文档,您应该在您的 ProgressDialog 实例上调用 setProgressNumberFormat (null) 来获取此行为

According to documentation, you should call setProgressNumberFormat (null) on your ProgressDialog instance to get this behavior

凹づ凸ル 2025-01-05 21:26:13

请访问链接。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文