1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
LinearBelotte1=(LinearLayout)v.findViewById(id.LayoutBelotte); // situe dans la methode onCreateView(....)
LinearBelotte1.removeAllViewsInLayout();
LinearBelotte1.setOrientation(LinearLayout.VERTICAL);
/*
LinearLayout.LayoutParams TEST = new LinearLayout.LayoutParams(LinearLayout.LayoutParams. FILL_PARENT ,LinearLayout.LayoutParams. FILL_PARENT) ;
TextView test = new TextView(getActivity());
test.setText("S'affiche bien");
LinearBelotte1.addView(test,TEST);
*/
LinearLayout.LayoutParams TEST = new LinearLayout.LayoutParams(LinearLayout.LayoutParams. FILL_PARENT ,LinearLayout.LayoutParams. FILL_PARENT) ;
LinearLayout.LayoutParams TEST1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams. FILL_PARENT ,LinearLayout.LayoutParams. WRAP_CONTENT) ;
LinearLayout.LayoutParams TEST2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams. FILL_PARENT ,LinearLayout.LayoutParams. FILL_PARENT) ;
TEST2.setMargins(2, 2, 2, 2);
tabDefautCapteur1= new TableLayout(getActivity());
tabDonnees1 = new TableRow(getActivity());
tabDonnees1.setLayoutParams(TEST1);
tabDonnees1.addView(generateTextView("Heures", TEST2,0));
tabDonnees1.addView(generateTextView("Capteur", TEST2,0));
tabDonnees1.addView(generateTextView("N°", TEST2,0));
tabDonnees1.addView(generateTextView("Donnees", TEST2,0));
tabDonnees1.addView(generateTextView("Rafraichissement", TEST2,0));
// On attribut a la ligne du tableau les différentes cases crées
tabDefautCapteur1.addView(tabDonnees1,TEST2);
LinearBelotte1.addView(tabDefautCapteur1,TEST); |
Partager