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

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -