更改控件中DrawableLeft圖片的大小,圖片與文字的距離


Drawable drawable=getResources().getDrawable(R.drawable.xx); //獲取圖片

  drawable.setBounds(left, top, right, bottom);  //設置圖片參數
  xx.setCompoundDrawablesRelativeWithIntrinsicBounds( null ,all, null , null );  //設置到哪個控件的位置()
 
 
圖片與文字距離 :屬性android:drawablePadding=""


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM