android 动态设置控件大小

转自:http://www.maxiaoguo.com/shipin/326.html


ImageView view = new ImageView(context);
view.setLayoutParams(new LinearLayout.LayoutParams(30, 30));

view.setpadding(0,0,0,0);

 

LayoutParams.WRAP_CONTENT
LayoutParams.FIL_PARENT

你可能感兴趣的:(android)