drawable drawable= getresources().getdrawable(r.drawable.icon);
//這個四引數指的是drawable將在被繪製在canvas的哪個矩形區域內。這個矩形區域的座標是以canvas左上角為座標原點的
drawable.setbounds(0, 0, drawable.getminimumwidth(), drawable.getminimumheight());
//可以在上、下、左、右設定圖示 沒有的可以設定為null 有就把drawable物件傳入mtextview.setcompounddrawables( left, top,right, bottom));
//這個方法可以取消radiobutton的圓環
radiobutton rb = new radiobutton(getcontext());rb.setbuttondrawable(0);
rb.setlayoutparams(new linearlayout.layoutparams(linearlayout.layoutparams.wrap_content,linearlayout.layoutparams.wrap_content,1));
rb.setbuttondrawable(0);
drawable drawable = getactivity().getresources().getdrawable(r.mipmap.top_line);
drawable.setbounds(0,0,drawable.getminimumwidth(),drawable.getminimumheight());
rb.setcompounddrawables(null,null,null,drawable);
jquery動態設定上下容器大小
最近做專案遇到乙個需求,需要上下 可以動態調節大小。效果如下 html 結構 class common tabbed content id paygridarea div dividingline div dividinglinewrap div class common tabbed conten...
動態改變大小
public class resize private void mousemove object sender,mouseeventargs e int sizeagex cursor.position.x this.frm.desktoplocation.x this.wtap this.ctr...
動態改變控制項大小
一 方法使用 getlayoutparams 和setlayoutparams 方法二 示例 linearlayout.layoutparams linearparams linearlayout.layoutparams aaa.getlayoutparams 取控制項aaa 當前的布局引數 li...