Lollipop Progress Bar Tinting

前端 未结 5 1619
再見小時候
再見小時候 2021-02-05 02:49

I\'m on a Lollipop device (MotoG 2014), I read about progress bar tinting, but this is not working...I get the default progress bar color. What am I missing here?



        
5条回答
  •  失恋的感觉
    2021-02-05 03:26

    /**change your progress drawable asrequired****/
    
       Drawable wrapDrawable = DrawableCompat.wrap(_progress.getIndeterminateDrawable());
       DrawableCompat.setTint(wrapDrawable, ContextCompat.getColor(this, R.color.colorOrange));
      _progress.setIndeterminateDrawable(DrawableCompat.unwrap(wrapDrawable));
    

提交回复
热议问题