给TextView设置动态图片

public static void settingDrawableTop(Context context, TextView view , int resourcesDrawable, int  resourcesString){
view.setVisibility(View.VISIBLE);
Drawable drawable = null;
drawable = context.getResources().getDrawable(resourcesDrawable);
if(drawable != null){
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); //设置边界
view.setCompoundDrawables(null, drawable, null, null);//图在上边
view.setText(resourcesString);
}
}
posted @ 2017-05-04 11:53  xiao_pengs  阅读(1470)  评论(0编辑  收藏  举报