button - Android : How to adjust Textview -


hello trying display content receive in activity using textview seems textview overlapping button have put in activity's ui.my goal put textview , button side side. have put textview in ui dynamically this:

string display = extras.getstring("extra_message");       textview textview = new textview(this);     textview.settextsize(40);     textview.setwidth(20);     textview.setheight(20);     textview.settext(display);      setcontentview(textview); 

i know miss cant find is,so can please suggest way how fix that?

thanks lot in advance!

when call setcontentview(textview); changes layout textview isn't overlapping button button isn't shown anymore. need add layout , put want it.

you can getting reference root view in xml , calling addview(textvie) on root view , use addrule() position textview want. however, if isn't necessary add textview dynamically easier declare in xml.

if want add dynamically still, this answer, , many more, covers it.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -