I am trying to add custom divider in RecyclerView
with GridLayoutManager
but not getting success, i have searched a lot and looked into below mention answer but it didn't help me
I want to put black line in between each items of RecyclerView
, something like below.
I have got horizontal line in between each row, but not able to find how to get those lines in between columns also.
chintan soni's answer worked perfectly, but it is creating problem in one scenario only, when i am having 5 views, it shows divider of other 3 items also, like below :
Check this out: https://bignerdranch.github.io/simple-item-decoration/
Add this to your app level gradle and sync:
Then, apply code as below:
My line_divider.xml was as follows:
This is just a quick answer from me. But this should work, I guess..
Output:
As per you have four columns I create as per that. This will have three straight vertical line for four columns