I learned how to create UI using XML file.But please help me to know how to do it programmatically without using XML files especially for other than LinearLayout.
Use the following code to create the TableLayout
TableLayout tbl=new TableLayout(context);
Use the below to create the Table row
TableRow tr=new TableRow(context);
add View into table row
tr.addView(view);
here view may be a TextView or EditText or ect..
add Table Row into TableLayout
tbl.addView(tr);
Like that you can add more table rows into Table Layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With