android - How to hide items in recyclerview
仅有的幸福
仅有的幸福 2017-05-16 13:21:42
0
3
880

Help:
How to hide any item in recyclerview, I have tried http://blog.csdn.net/u0110601... and http://blog.csdn.net/rgen_xia...,
did not succeed,

The layoutparams obtained in onBindViewHolder is null, and params.height cannot be set.
Getting the highest level in itemview also cannot obtain params

仅有的幸福
仅有的幸福

reply all(3)
伊谢尔伦

The reason why you get the layoutparams as null is that you did not give it to the parent when you LayoutInfalter. When you infalter, you gave the parent parameters, and then you can get them. Then if you want to hide a certain one, just visible gone height 0.

我想大声告诉你

Can’t you just remove the corresponding item from the array?

滿天的星座

can’t get itLayoutParams, 你可以new ViewGroup.LayoutParams(...)然后View#setLayoutParams(...)ah

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template