android - Create new RelativeLayout above existing TextView -


i have issue creation of new relativelayout above existing textview in app.

my main layout called contentlayout , inside have textview called addroombutton :

relativelayout contentlayout = (relativelayout) findviewbyid(r.id.contentlayout); textview addroombutton = (textview) findviewbyid(r.id.addroomtext); 

i want add new relativelayout above textview wrote :

relativelayout relativelayout = new relativelayout(this); relativelayout.setid(r.id.roomrelativelayout); relativelayout.layoutparams rlp = new relativelayout.layoutparams(        relativelayout.layoutparams.match_parent,        100 ); rlp.addrule(relativelayout.align_parent_top); rlp.addrule(relativelayout.align_parent_left); rlp.addrule(relativelayout.above, addroombutton.getid()); contentlayout.addview(relativelayout, rlp); 

the relativelayout created on top of contentlayout, textview not visible. think it's behind relativelayout i'm not sure...

is there solutons put textview below new relativelayout without creating linearlayout or other layouts?

why wouldn't xml?

layout_below=""


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -