android - set the width of the button to the LinearLayout programmatically -
i trying set width of button in lila linearlayout getting in screenshot. how can set width button? facing problem item number beside checkboxes little bit higher level of checkbox. how can configure programmatically set them same level ?
private void createradiobutton(final arraylist<integer> items) { final linearlayout ll = (linearlayout) findviewbyid(r.id.lila); (int = 0; < items.size(); i++) { checkbox cb = new checkbox(this); cb.settext(items.get(i) + "\n"); cb.setid(i + 10); ll.addview(cb); } button btn = new button(this); btn.settext("submit"); // line below not getting button displayed. //btn.setlayoutparams(new linearlayout.layoutparams(10, 40)); ll.addview(btn); } screenshot: 
about number displayed higher checkbox.
in code cb.settext(items.get(i) + "\n"); putting new line, next checkbox diplayed number , new line
Comments
Post a Comment