这里写自定义目录标题
RecyclerView item条数不足时平均分布parent的实现
需要利用横向recyclerview实现tab效果,但是使用过程中发现item全都靠前排列。
在Adapter中onBindViewHolder加入
ViewGroup.LayoutParams layoutParams = holder.itemView.getLayoutParams();
layoutParams.width = parent.getMeasuredWidth()/getItemCount();
则可以实现item平均分布页面。
https://blog.csdn.net/bingdian__2011/article/details/79402069?utm_source=blogxgwz7