TextView 代码加载上下左右drawable

来源:互联网 发布:淘宝全屏代码在线生成 编辑:程序博客网 时间:2024/05/29 14:36

关键代码

Drawable drawable=getResources().getDrawable(R.drawable.img_ytzyy);drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());tv_summarize.setCompoundDrawables(drawable, null, null, null);`

需要注意的是:方法setBounds()中参数的含义,(左,上,右,下)

0 0