TextView setCompoundDrawables不显示

记录一个bug:

执行代码:
Drawable openIcon = context.getResources().getDrawable(R.drawable.drip_mail_opened);
holder.timeTv.setCompoundDrawables(openIcon, null, null, null);
Icon不显示;
 
 
修改如下:
 
 
Drawable openIcon = context.getResources().getDrawable(R.drawable.drip_mail_opened);
openIcon.setBounds(0, 0, 24, 24);
holder.timeTv.setCompoundDrawables(openIcon, null, null, null);
则Icon显示正常。

猜你喜欢

转载自blog.csdn.net/kanglupeng/article/details/54585776