android: deux questions à l'aide de Tablerow+TextView dans Tablelayout

Je suis en utilisant Tablerow+TextView pour faire un simple point de vue pour les blogs et leurs réponses. Dans chaque TableRow j'ai mis un TextView. Maintenant, j'ai deux questions:

  1. Le texte qui est plus long que l'écran ne sera pas automatiquement automatiquement jusqu'à être multi-lignes. Il est par la conception de TableRow? J'ai déjà mis en tr_content.setSingleLine(false); [mise à jour] Ce point a été abordé, je pense que je devrais changer Fill_parent être Wrap_content dans textView.tr_author_time.setLayoutParams(new LayoutParams(
    LayoutParams.**WRAP_CONTENT**,
    LayoutParams.WRAP_CONTENT));

  2. La Table ne faites défiler comme ListView. Mes lignes sont plus que la taille de l'écran. J'attends le tableau pourrait être défile vers le bas pour la visualisation comme ListView. Est-ce possible?

Voici mon code:

    TableLayout tl = (TableLayout) findViewById(R.id.article_content_table);
TextView tr_title = new TextView(this);
TextView tr_author_time = new TextView(this);
TextView tr_content = new TextView(this);
TableRow tr = new TableRow(this);
for(int i = 0; i < BlogPost.size(); i++){
try{
//add the author, time
tr = new TableRow(this);
/////////////////add author+time row
BlogPost article = mBlogPost.get(i);
tr_author_time = new TextView(this);
tr_author_time.setText(article.author+"("+
article.post_time+")");
tr_author_time.setTextColor(getResources().getColor(R.color.black));
tr_author_time.setGravity(0x03);
tr_author_time.setLayoutParams(new LayoutParams( 
LayoutParams.FILL_PARENT, 
LayoutParams.WRAP_CONTENT)); 
tr.addView(tr_author_time); 
tl.addView(tr,new TableLayout.LayoutParams( 
LayoutParams.FILL_PARENT, 
LayoutParams.WRAP_CONTENT));
//////////////////////then add content row
tr = new TableRow(this);            
tr_content = new TextView(this);
tr_content.setText(article.content);
tr_content.setSingleLine(false);
tr_content.setGravity(0x03);
tr_content.setLayoutParams(new LayoutParams( 
LayoutParams.FILL_PARENT, 
LayoutParams.WRAP_CONTENT));            
tr.addView(tr_content);       
tr.setBackgroundResource(R.color.white);
tl.addView(tr,new TableLayout.LayoutParams( 
LayoutParams.FILL_PARENT, 
LayoutParams.WRAP_CONTENT));
}   
Comment peut-on faire deux lignes d'égale Hauteur ? Veuillez voir ma question stackoverflow.com/q/10779802/720176

OriginalL'auteur Yang | 2010-04-21