Drawable drawable=getResources().getDrawable(R.drawable.xx); //獲取圖片drawable.setBounds(left,?top,?right,?bottom); ?//設置圖片參數xx.setCompoundDrawablesRelativeWithIntrinsicBounds(null,all,null,null); ?//設置到哪個控件的位置()
代碼實例:
Drawable drawable=getResources().getDrawable(R.drawable.xx); //獲取圖片drawable.setBounds(left,?top,?right,?bottom); ?//設置圖片參數xx.setCompoundDrawablesRelativeWithIntrinsicBounds(null,all,null,null); ?//設置到哪個控件的位置()
代碼實例: