人生最曼妙的风景,竟是内心的淡定与从容!
In reusing controls, the most important detail is: if there is an if, there must be an else
Add code that specifies the selected state to Onbindholder. As mentioned above, the selected state must be set whether it is true or false.
View cache reuse problem. Use if else to handle it differentlyif else做不同处理
if else
不同类型item 重写 getItemViewType()
getItemViewType()
getItemViewType()
Look at my article, although it is not recyclerview, you can refer to it: https://segmentfault.com/a/1190000004906...
In reusing controls, the most important detail is: if there is an if, there must be an else
Add code that specifies the selected state to Onbindholder. As mentioned above, the selected state must be set whether it is true or false.
View cache reuse problem. Use
if else
to handle it differentlyif else
做不同处理不同类型item 重写
getItemViewType()
getItemViewType()
for different types of items🎜🎜 🎜Look at my article, although it is not recyclerview, you can refer to it: https://segmentfault.com/a/1190000004906...