进展单位ProgressDialog [英] Progress unit in ProgressDialog

查看:156
本文介绍了进展单位ProgressDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android的 ProgressDialog 允许您设置目前的进展和最大值为整数。这些值显示这样的对话框:

Android's ProgressDialog allows you to set the current progress and maximum value as integers. These values are shown in the dialog like this:

一万零二十三分之三千四百零一

3401/10023

其中的第一个数字是目前的进展,而第二个数字是最大值。

Where the first number is the current progress, and the second number is the maximum value.

我想也显示测量单位。事情是这样的:

I would like to also show the unit of measurement. Something like this:

一万〇二十三分之三千四百〇一 KB

3401/10023 KB

使用ProgressDialog这可能吗?如果没有,你推荐这样做把这个信息传递给用户的是什么?我想,以避免重新实现ProgressDialog只包括单位。

Is this possible using ProgressDialog? If not, what do you recommend doing to give this information to the user? I'm trying to avoid reimplementing ProgressDialog just to include the unit.

推荐答案

这是API 11起,您可以拨打下面的函数来实现你的目的。

Starting from API 11, you can call the following function to achieve your purpose.

mProgressDialog.setProgressNumberFormat("%1d/%2d kB") 

这篇关于进展单位ProgressDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆