【问题标题】:How to remove progress bar number at the bottom part of the progress bar?如何删除进度条底部的进度条编号?
【发布时间】:2011-10-17 12:51:20
【问题描述】:

如何去掉图片上的圆圈?

非常感谢您的帮助! :)

【问题讨论】:

  • 你必须自己制作进度条。

标签: android progress-bar


【解决方案1】:

在创建ProgressDialog 时,将null 传递给setProgressNumberFormat()setProgressPercentFormat()。请注意,这仅适用于 API 级别 11 及更高版本。

【讨论】:

  • 感谢您的回复@CommonsWare,太糟糕了,我正在使用 API 8。您知道任何解决方法吗?
  • @Emkey:更改为使用 API 级别 11,或使用反射来调用这些方法。 AFAIK,以前版本的 Android 上不存在进度编号和百分比。或者,不要使用ProgressDialog
  • @CommonsWare:这是正确的。进度号和百分比也将显示在以前的 API 级别中。我也在寻找解决方法
  • @CommonsWare 如何显示下载的 KB/MB 进度。我想显示与我们从 Play 商店下载应用程序时相同的进度。
  • @CommonsWare 这是我的问题stackoverflow.com/questions/14101562/…,如果你能指导我,那就太好了。谢谢...
【解决方案2】:

我需要一个类似的功能 -> 当 progressDialog 处于不确定状态时隐藏百分比和最小值/最大值。

private void setIndeterminate(boolean isIndeterminate) {
    progressDialog.setIndeterminate(isIndeterminate);
    if (isIndeterminate) {
        progressDialog.setProgressNumberFormat(null);
        progressDialog.setProgressPercentFormat(null);
    } else {
        progressDialog.setProgressNumberFormat("%1d/%2d");
        NumberFormat percentInstance = NumberFormat.getPercentInstance();
        percentInstance.setMaximumFractionDigits(0);
        progressDialog.setProgressPercentFormat(percentInstance);
    }
}

【讨论】:

    【解决方案3】:

    如果您想从进度对话框中禁用上述号码状态,那么您应该删除此代码。

    progress1.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    

    这里我将向您展示如何创建不会显示任何状态的进度条

    progress1.setMessage("Fetching Files...! ");
    progress1.setIndeterminate(true);             
     progress1.show();
    

    【讨论】:

      猜你喜欢
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-16
      相关资源
      最近更新 更多