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]); }
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
Post a Comment