I have a radiogroup in xml, and the buttons are generated programmatically. How do I add spacing between the buttons programmatically.
I thought it was something like LayoutParams
but my object doesn't come with an obvious setPadding
or setMargins
method.
This is what I was trying
RadioButton currentButton = new RadioButton(context);
currentButton.setText(item.getLabel());
currentButton.setTextColor(Color.BLACK);
//add padding between buttons
LayoutParams params = new LayoutParams(context, null);
params. ... ??????
currentButton.setLayoutParams(params);