Android 动态设置属性
2020-03-11 本文已影响0人
菜鸟冰
LinearLayout.LayoutParams lp
=newLinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(10,20,30,40);
imageView.setLayoutParams(lp);
LinearLayout.LayoutParams lp
=newLinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(10,20,30,40);
imageView.setLayoutParams(lp);