【问题标题】:Get ProgressBar object from ProgressDialog从 ProgressDialog 获取 ProgressBar 对象
【发布时间】:2016-01-07 16:03:49
【问题描述】:

有什么方法可以从 ProgressDialog.java 类中获取“mProgress”对象?

我想将不确定的微调器的颜色设置为白色,并为其保持相同的 android 样式。我见过使用样式的解决方案,但没有一个真正符合标准。我希望一切都与它完全相同,只是颜色是白色的。

我想要 mProgress 对象的原因是我可以在上面使用以下代码:

mProgressBar.getIndeterminateDrawable().setColorFilter(new LightingColorFilter(0xFF000000, 0xFFFFFF));

【问题讨论】:

    标签: android dialog progressdialog


    【解决方案1】:

    找到了!

    ProgressDialog progress = new ProgressDialog(this);
    AlertDialog alert = progress; // not sure if you need this bit, required for what I do 
    
    ProgressBar prog = (ProgressBar)progress.findViewById(android.R.id.progress);
    prog.getIndeterminateDrawable().setColorFilter(new LightingColorFilter(0xFF000000, 0xFFFFFF));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-11
      • 1970-01-01
      • 2011-01-05
      相关资源
      最近更新 更多