有时会在不同的vie上添加上下左右图片,在xml中直接drawableRight等,也可在代码中直接设置:
Drawable dra= getResources().getDrawable(R.drawable.icon_casede_play);
//必须设置bounds,不然不会成功
dra.setBounds( 0, 0, dra.getMinimumWidth(),dra.getMinimumHeight());
//setCompoundDrawables(左,上,右,下);
自己的view.setCompoundDrawables(null,null,dra,null);
view动态设置上下左右图片
最新推荐文章于 2023-12-28 15:11:38 发布