1.如果该View的父控件为RelativeLayout,设置margin如下:
ImageView image = (ImageView) findViewById(.main_image);
lp = new (());
(50, 100, 0, 0);
(lp);
如果父控件为LinearLayout同上,将RelativeLayout换成LinearLayout即可
2.如果该View就为最外层的LinearLayout,设置margin如下:
params = new (.MATCH_PARENT, .MATCH_PARENT);
(4, 0, 4, 0);
LinearLayout ll = (.ll_item);
(params);