LinearLayout.LayoutParams linearParams =(LinearLayout.LayoutParams) textView.getLayoutParams(); //取控件textView当前的布局参数 linearParams.height = 20;// 控件的高强制设成20  

linearParams.width = 30;// 控件的宽强制设成30   

textView.setLayoutParams(linearParams); //使设置好的布局参数应用到控件

 

 

图片宽度:

LayoutParams para1;
para1 = headimg_iv.getLayoutParams();
para1.height = _h;
headimg_iv.setLayoutParams(para1);

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案