Code example for TableRow

Methods: addView, setLayoutParams, setPadding

0
			anzahl = 9;
		} 
 
		for (int j = 0; j < anzahl; j++) {
			// Erstellen einer neuen Zeile f�r die Tabelle 
			TableRow row_menue = new TableRow(this);
			row_menue.setLayoutParams(new LayoutParams(300,
					LayoutParams.WRAP_CONTENT));
 
			// Erstellen eines neuen TextViews f�r die Zeile 
			TextView text_title = new TextView(this);
			TextView text_beschreibung = new TextView(this);
			// Attribute der Text_Views setzen 
			text_title.setWidth(100);
			text_beschreibung.setWidth(200);
			text_title.setTextColor(Color.BLACK);
			text_beschreibung.setTextColor(Color.BLACK);
			text_title.setTextSize(9);
			text_beschreibung.setTextSize(9);
 
			// Text in die Text Views schreiben 
			text_title.setText(menueS1[j]);
			text_beschreibung.setText(menueS2[j]);
			// Text-Views der Tabellenzeile zuordnen 
			row_menue.setPadding(0, 4, 0, 0);
			row_menue.addView(text_title);
			row_menue.addView(text_beschreibung);
			// Tabellenzeile der vorhandenen Inhaltstabelle zuordnen 
			table.addView(row_menue);
		} 
 
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE