直接在Activity中使用 setAdapter(adapter) 之后添加
Data:数据源
rv_tixian_backcard_item: Recyclerview
ViewGroup.LayoutParams lp = rv_tixian_backcard_item.getLayoutParams();
if (Data.size() >5) {
lp.height = DensityUtil.dip2px(this,52 *5);
}else {
lp.height = DensityUtil.dip2px(this,54 *ListBeanSecond.size());
}
rv_tixian_backcard_item.setLayoutParams(lp);
网友评论