Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 4, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/3cbcd1f8bc497d005812c42584e363ea to your computer and use it in GitHub Desktop.
Save parzibyte/3cbcd1f8bc497d005812c42584e363ea to your computer and use it in GitHub Desktop.
// Primero dibujar el encabezado; esto es poner "TALLAS" y a la derecha todas las tallas
TableRow fila = new TableRow(getActivity());
TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);
fila.setLayoutParams(lp);
// Borde
fila.setBackgroundResource(R.drawable.borde_tabla);
//El elemento de la izquierda
TextView tv = new TextView(getActivity());
tv.setTypeface(null, Typeface.BOLD);
tv.setText("TALLAS");
fila.addView(tv);
// Ahora agregar las tallas
for (int x = 0; x < tallas.length; x++) {
TextView tvTalla = new TextView(getActivity());
tvTalla.setText(tallas[x]);
fila.addView(tvTalla);
}
// Finalmente agregar la fila en la primera posición
tableLayout.addView(fila, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment