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: enter image description here

about number displayed higher checkbox.
in code cb.settext(items.get(i) + "\n"); putting new line, next checkbox diplayed number , new line


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -