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:

dynamically filling table layout table rows


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -