项目中遇到在代码中设置textview设置图标不显示的问题,后来知道图标必须setBounds
viewHolder.idTvTitle.setText(MainStone);
Drawable dra = getResources().getDrawable(R.drawable.icon_add2);
dra.setBounds(0, 0, dra.getMinimumWidth(), dra.getMinimumHeight());
viewHolder.idTvTitle.setCompoundDrawables(null,null,null,dra);