Created
October 4, 2019 18:58
-
-
Save parzibyte/3cbcd1f8bc497d005812c42584e363ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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