How to set the height of an item row in GridLayoutManager

后端 未结 8 710
有刺的猬
有刺的猬 2021-01-31 03:18

My Recycler Item which inflate in onCreateViewHolder




        
8条回答
  •  野性不改
    2021-01-31 04:07

    v.getLayoutParams().width = parent.getMeasuredWidth() / 2;
    
    v.getLayoutParams().height = parent.getMeasuredWidth() / 2;
    

提交回复
热议问题