eclipse - create multiple runtime textview in android -
i have code in eclipse create multiple textview in multiple rows when run application items don't show, please me how fix it.
this code:
public void createinputboxes(activity gameplay, int colnums, int rownums, tablelayout.layoutparams lparams, tablelayout puzzlelayout) { textview[][] puzcels = new textview[colnums][]; puzzlelayout.removeallviews(); for(int c=0; c<colnums; c++) { puzcels[c]=new textview[rownums]; tablerow tr = new tablerow(gameplay); tr.setlayoutparams(lparams); for(int r=0; r<rownums; r++) { puzcels[c][r] = new textview(gameplay); puzcels[c][r].setlayoutparams( lparams); puzcels[c][r].setid(tvid); puzcels[c][r].settext("?"); tvid++; puzcels[c][r].setbackgroundcolor(0xffffb90f); tr.addview(puzcels[c][r]); } puzzlelayout.addview(tr,lparams); } }
you using tablelayout.layoutparams params of views - tablelayout, tablerow , textview. won't work last two. need give them params work them:
Comments
Post a Comment