Dynamically adding the text view in android
I am new to android I have table layout which contains a single table row.. This row has got two text views in the first and s开发者_开发技巧econd column respectively..
Can anyone tell me how to add these two text views present inside the table row dynamically ??
provided you've set content view to layout with TableRow:
TextView tv1 = new TextView(this);
TextView tv2 = new TextView(this);
TableRow tr = (TableRow)findViewById(R.id.<your table row id>);
//apply layout params to your TextViews, set text etc...
tr.addView(tv1);
tr.addView(tv2);
精彩评论