android - GridLayout LayoutParams - programmatically apply weight and span -


i want apply colspan , rowspan on gridlayout programmatically. have searched lot same. have doubts:

  1. is there other way can create gridlayout params programmatically??
  2. can create using generatelayoutparams(attributeset attrs) method? if yes how should it. how can create attributeset programmatically. appreciated. in advance!

if have height , width , want create gridlayout params programmatically use :

gridlayout.layoutparams param =new gridlayout.layoutparams(); param.height = layoutparams.wrap_content; param.width = layoutparams.wrap_content; layoutparams.rowspec = gridlayout.spec(gridlayout.undefined, item.getrowspan()); layoutparams.columnspec = gridlayout.spec(gridlayout.undefined, item.getcolumnspan());  gridlayout.setlayoutparams(param); 

Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -