我想以全屏方式查看背景图像。我该怎么做?我想从Java代码中设置我的* TableLayout 全屏。
tableLayout = new TableLayout(this);
tableLayout.setGravity(Gravity.CENTER);
tableLayout.setBackgroundResource(R.drawable.lavagna);
答案 0 :(得分: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设置为全屏