how to set View height in tablelayout in android? -
how to set View height in tablelayout in android? -
i have problem want set view in table layout , manage height not able set height. taking bydefault height.
note:- view in reddish color
please give me thought this.
/* code */
tablelayout.addview(tablerow);
view lineview = new view(this); lineview.setlayoutparams(new tablelayout.layoutparams(layoutparams.wrap_content, layoutparams.wrap_content, 1f)); //lineview.setpadding(0, 1, 0, 0); //lineview.setminimumheight(1); lineview.setbackgroundresource(r.drawable.red); tablelayout.addview(lineview); final viewgroup.marginlayoutparams lpt =(marginlayoutparams)lineview.getlayoutparams(); lpt.setmargins(lpt.leftmargin,lpt.topmargin,lpt.rightmargin,lpt.bottommargin=2);
/* , layout */
"thanks"
you need set width , height of view in line...
lineview.setlayoutparams(new tablelayout.layoutparams(layoutparams.wrap_content, layoutparams.wrap_content, 1f));
you giving height , width of table view view(in reddish color) has same height tablelayout
change line custom height , width
lineview.setlayoutparams(new linearlayout.layoutparams(50,50));
android
Comments
Post a Comment