TextView 动态设置图片

                Drawable drawable = getResources().getDrawable(R.drawable.find_zan_noclick);
                drawable.setBounds(0, 0, 25, 25);//第一0是距左边距离,第二0是距上边距离,40分别是长宽
                textView.setCompoundDrawables(drawable, null, null, null);//只放左边
                textView.setCompoundDrawablePadding(10);
                textView.setText("123");

猜你喜欢

转载自blog.csdn.net/wuqingsen1/article/details/81035385