0
Je souhaite afficher un tableau de chaînes dans la disposition de table. Avoir le code suivant. Je suis capable d'obtenir les données dans le dossier de notation mais la disposition de table je ne vois rien.Problème lié à TableLayout
TableLayout tl=(TableLayout)findViewById(R.id.maintable);
for(int current=0;current<cursor1.getCount();current++)
{
//create a table row
TableRow tr=new TableRow(this);
tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
// create a text view for start time
TextView sTime= new TextView(this);
sTime.setText(values[current]);
sTime.setTextColor(Color.YELLOW);
Log.i("Data Check", values[current]);
sTime.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
tr.addView(sTime);
//add the table row into TableLayout
tl.addView(tr, new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
}
nous allons avoir besoin de votre mise en page xml ... –
i juste après il. – PiyushMishra
Vous avez le problème mais je ne peux pas le résoudre. chaque fois que je change la valeur de setText pour un texte statique cela fonctionne bien mais la chose est dans mon journal je peux voir les valeurs [courant] fonctionne correctement mais dans la disposition de table cela ne fonctionne pas. – PiyushMishra