練習(xí)的demo
http://download.csdn.net/download/jingerlovexiaojie/10164877
http://download.csdn.net/download/jingerlovexiaojie/10164877
2017-12-19
應(yīng)該再加入
ViewGroup.LayoutParams thislp=getLayoutParams();
if(thislp.width>0)
sizeWidth=thislp.width;
if(thislp.height>0)
sizeHeight=thislp.height;
ViewGroup.LayoutParams thislp=getLayoutParams();
if(thislp.width>0)
sizeWidth=thislp.width;
if(thislp.height>0)
sizeHeight=thislp.height;
2017-06-16
API 24中,MarginLayoutParams已經(jīng)不能直接寫入(Wrap_Content,Wrap_Content),無耐之下,使用了以下二傳手法:
LayoutParams lp=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewGroup.MarginLayoutParams lp2=new ViewGroup.MarginLayoutParams(lp);
LayoutParams lp=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewGroup.MarginLayoutParams lp2=new ViewGroup.MarginLayoutParams(lp);
2017-01-06