Guest User

Untitled

a guest
Jul 11th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. // Create a TableRow and give it an ID
  2. TableRow tr = new TableRow(this);
  3. tr.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
  4. Button btnManageGroupsSubscriptions = new Button(this);
  5. btnManageGroupsSubscriptions.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 40));
  6.  
  7. tr.addView(btnManageGroupsSubscriptions);
  8. contactsManagementTable.addView(tr);
  9.  
  10. TableRow tr = new TableRow(this);
  11. TableLayout.LayoutParams tableRowParams=
  12. new TableLayout.LayoutParams
  13. (TableLayout.LayoutParams.FILL_PARENT,TableLayout.LayoutParams.WRAP_CONTENT);
  14.  
  15. int leftMargin=10;
  16. int topMargin=2;
  17. int rightMargin=10;
  18. int bottomMargin=2;
  19.  
  20. tableRowParams.setMargins(leftMargin, topMargin, rightMargin, bottomMargin);
  21.  
  22. tr.setLayoutParams(tableRowParams);
Add Comment
Please, Sign In to add comment