0

我想全屏查看背景图像。我该怎么做?我想从 Java 代码中设置我的 * TableLayout全屏。

tableLayout = new TableLayout(this);
tableLayout.setGravity(Gravity.CENTER); 
tableLayout.setBackgroundResource(R.drawable.lavagna);
4

1 回答 1

5
tableLayout = new TableLayout(this);
TableLayout.LayoutParams params = new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
tableLayout.setGravity(Gravity.CENTER); 
tableLayout.setBackgroundResource(R.drawable.lavagna);
tableLayout.setLayoutParams(params);

尝试上面的代码来设置tablelayout全屏

于 2012-04-24T16:52:57.540 回答