How to align linear layouts in relative layout by programatically in android -
|--------------------|--> relative layout |horizontal linear 1 | |horizontal linear 2 | |horizontal linear 3 | |--------------------|
in way.
i want create 1 lay out new contact in android phone.when press + symbol add text box , 1 remove button dynamically.please answer this. or other way format... thank u friends :)
i tried this.
ll = new linearlayout(this); ll.setlayoutparams(new layoutparams(linearlayout.layoutparams.match_parent, linearlayout.layoutparams.wrap_content)); textview tv = new textview(this); edittext ed = new edittext(this); button bob = new button(this); tv.settext("nextval"); ed.sethint("number"); ed.setid(++i); ed.setinputtype(inputtype.type_class_number); bob.settext("rem"); bob.setid(i); ll.setorientation(linearlayout.horizontal); allet.add(ed); ll.addview(tv); ll.addview(ed); ll.addview(bob); ll.setid(i); allli.add(ll); rl.addview(ll);
you don't want add linearlayout params linear layout. want add relativelayout.layoutparams because parent relativelayout. can add rules params, @maxim efimov suggested.
Comments
Post a Comment