Salve a tutti,
vorrei rendere full screen e adattabile alla maggior parte dei cellulari questa parte di codice che mi crea un layout scorrevole sia orizzontalmente che verticalmente, nello specifico inoltre vorrei che la matrice di edit text appaia centralmente nello schermo, non so proprio come fare spero mi possiate dare una mano grazie mille
HorizontalScrollView HSC = new HorizontalScrollView(this);
ScrollView VSC = new ScrollView(this);
VSC.setBackgroundResource(R.drawable.lavagna_psd);
tableLayout = new TableLayout(this);
tableLayout.setGravity(Gravity.CENTER);
values = new EditText[3][3];
for (int i = 0; i < 3; i++) {
tableRow = new TableRow(this);
tableRow.setGravity(Gravity.CENTER);
for (int j = 0; j < 3; j++) {
values[i][j] = new EditText(this);
values[i][j].setHint("r: " + (i) + " " + "c: " + (j));
values[i][j].setPadding(10, 10, 10, 10);
tableRow.addView(values[i][j]);
}
tableLayout.addView(tableRow);
}
VSC.addView(tableLayout);
HSC.addView(VSC);
setContentView(HSC);
button1 = new Button (this);
button1.setText("Insert Values");
tableLayout.addView(button1);