刚才用
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(300, LayoutParams.WRAP_CONTENT);
lp.setMargins(100, 30, 0, 0);
linearLayout.setLayoutParams(lp);
后linearLayout不能显示,被卡住了好久,最后得知该linearLayout在TableRow里面的,所以得用
TableRow.LayoutParams lp = new TableRow....