//獲取資源圖片
Drawable leftDrawable = getResources().getDrawable(R.drawable.comment_parise);
//設置圖片的尺寸,奇數位置后減前得到寬度,偶數位置后減前得到高度。
leftDrawable.setBounds(0, 0, 30, 30);
//設置圖片在TextView中的位置
tvMain.setCompoundDrawables(leftDrawable, null, null, null);