//设置item的高度跟随宽度走
ViewGroup.LayoutParams parm = holder.layoutContent.getLayoutParams();
parm.height = gridLayoutManager.getWidth()/ gridLayoutManager.getSpanCount()
- 2*holder.layoutContent.getPaddingLeft() - 2*((ViewGroup.MarginLayoutParams)parm).leftMargin;
Android中RecycleView列表动态设置item宽高相同的正方形
原文作者:codekxx
原文地址: https://blog.csdn.net/codekxx/article/details/90521464
本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
原文地址: https://blog.csdn.net/codekxx/article/details/90521464
本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。