Loading dynamic imageviews in loop in Android creating gaps -
i reading data soap service , using data load images res folder locally. using loop because there 6 images being loaded. code :
final tablelayout tbllay = (tablelayout)findviewbyid(r.id.lottotl); final layoutparams params = new tablelayout.layoutparams(layoutparams.match_parent, layoutparams.wrap_content); for(int i=2;i<9;i++) { final imageview image = new imageview(lastdraw.this); image.setlayoutparams(trparams); image.setmaxheight(20); image.setmaxwidth(20); string imgname = "img_" + split[i].substring(split[i].indexof("=") + 1); int id = getresources().getidentifier(imgname, "drawable", getpackagename()); image.setimageresource(id); row2.setlayoutparams(params); row2.addview(image); } tbllay.addview(row2);
the issue having there gap between first image , consecutive images.
it looks (each number representing image):
1.........23456
i thinking has layout of row in tablelayout, wrong.
thank you
anyone?
figured out ... feel kind of stupid but, learnt something! load textview first row , imageviews second row. textview in first column , width making first column stretch ... why there gap.