android - Unable to display all the buttons in TableLayout -


i generating buttons onto screen programatically code

       tablelayout mainlayout = new tablelayout(this);     mainlayout.setlayoutparams(new tablerow.layoutparams(tablerow.layoutparams.wrap_content, tablerow.layoutparams.match_parent));     //mainlayout.setstretchallcolumns(true);      ( int =0 ; < gridsize ; i++){         rowarr[i] = new tablerow(this);         for(int j = 0; j < gridsize ; j++){              button button = new button(this);             button.settext(integer.tostring(i)+","+integer.tostring(j));             button.settextsize(150/gridsize);             button.setmaxheight(450/gridsize);             button.setmaxwidth(600/gridsize);             rowarr[i].addview(button);          }         mainlayout.addview(rowarr[i]);     } 

enter image description here

by seeing image can entire column of buttons missing.

only after setting gridsize 6 or more problem occur.

i able see 6th row on emulator.i guess phone width issue


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -