TextView setCompoundDrawables不显示

来源:互联网 发布:网达软件 股票 编辑:程序博客网 时间:2024/04/27 13:59

记录一个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显示正常。

0 0
原创粉丝点击