解决recycleView嵌套recycleView时内层rv添
2017-11-29 本文已影响0人
singularit_bc15
item间距增大的原因是重复addItemDecoration了,所以addItemDecoration时判断一下(viewHolder.rvGuessItem为recycleView)
if(viewHolder.rvGuessItem.getTag(viewHolder.rvGuessItem.getId())!=null&&viewHolder.rvGuessItem.getTag(viewHolder.rvGuessItem.getId()).equals("addedDecoration")){
}else{
viewHolder.rvGuessItem.addItemDecoration(newLinerItemDecoration(10,0));//设置item间距
viewHolder.rvGuessItem.setTag(viewHolder.rvGuessItem.getId(),"addedDecoration");
}