Code example for TableLayout.LayoutParams

0
 
public class UI { 
	public static TableRow addTableRow(Context context) {
    	// create a new TableRow   
        TableRow row = new TableRow(context);
        TableLayout.LayoutParams params = new LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);
         
        row.setLayoutParams(params);
    	return row;
    } 
     
    public static TextView addTextView(String text, Context context) {
    	TextView tv = new TextView(context);
    	tv.setText(text);
    	 
    	return tv;
    } 
     
    public static Button addButton(String text, Context context) {
    	Button btn = new Button(context);
Stop searching for code, let great code find you!  Add Codota to your java IDE