Ho creato TableRows
dinamicamente nel codice e voglio impostare i margini per questi TableRows
.Programmare il margine per TableRow
mio TableRows
creato come segue:
// Create a TableRow and give it an ID
TableRow tr = new TableRow(this);
tr.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
Button btnManageGroupsSubscriptions = new Button(this);
btnManageGroupsSubscriptions.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 40));
tr.addView(btnManageGroupsSubscriptions);
contactsManagementTable.addView(tr);
Come posso dinamicamente impostare i margini di questi?
Ha funzionato! Tnx !!! – ofirbt
Che ne dici di una visualizzazione testuale? setMargins undefined per textView. – Jaseem
Non ha funzionato. Ma la risposta di @mik sotto funzionava, e avrebbe dovuto essere la risposta accettata – Zvi