Method for removing bottom split line of recyclerview

summary

We threw a problem before, that is, when the recyclerview displays the list, there is a dividing line behind the last item at the bottom, which greatly affects the beauty of the interface. This article is to solve this problem.

Custom split line

After analyzing the source code, we found that there is no relevant method to deal with this requirement, so we can only customize the split line. Based on the previous article, we know that it must be to modify getitemoffsets. Then our idea is to make this method not offset the gap of the division line when reaching the last item. At the same time, modify the OnDraw method so that it no longer draws the last split line.

The effect of using this custom split line is as follows:

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>