首页 > 技术文章 > PrograssBar的setIndeterminateDrawable不起作用

dubo- 2016-06-14 00:21 原文

是设置绘制不显示进度的进度条的Drawable对象
使用中发现,在xml中设置IndeterminateDrawable可以正常使用,但是如果需要在代码中更换图片使用setIndeterminateDrawable时,PrograssBar被隐藏掉。

此时应使用方法

Drawable d = this.getResources().getDrawable(R.id.dd);

d.setBounds(1,1,16,16);

progressBar.setIndeterminateDrawable(d);

推荐阅读