I am working on Android Studio with TableLayout, I am showing data and I would like the head (name of the columns) to be fixed in such a way that when I do Scroll horizontally everything moves but when I do a vertical Scroll, just move the data, but not the names of the columns.
I've been working this way:
TableLayout tabla = (TableLayout) findViewById(R.id.tablaid);
//La fila de las cabezas(Nombre de columnas)
TableRow cabezas = new TableRow(this);
for(int i=0;i<tamañoX; i++){
TextView nombreCol = new TextView(this);
nombreCol.setText("Columna "+i);
cabezas.addView(nombreCol);
}
tabla.addView(cabezas); //con esto ya agregue el nombre de las columnas
//La fila de los datos
for(int i=0;i<tamañoX; i++){
TableRow datos = new TableRow(this);//este TableRow lo coloco dentro del for, porque representa cada fila de la tabla(datos)
TextView datitos = new TextView(this);
datitos.setText("datitos "+i);
datos.addView(datitos);
tabla.addView(datos);//agrego filas
}