Lollipop Progress Bar Tinting

前端 未结 5 1622
再見小時候
再見小時候 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

    Try changing your ProgressBar to this

    
    

    Also you can do it programmaticaly doing this :

    ProgressBar progressBar;
    progressBar = (ProgressBar)findViewById(R.id.view_progress);
    progressBar.getProgressDrawable().setColorFilter(Color.RED, Mode.SRC_IN);
    

    References

    Setting in ProgressBar Tint color

提交回复
热议问题