thankyou so much. Your solutions are helping me. i am doing a project called offline android dictionary. I av the search view and recycler view as my activity_main.xml. I stored and wrote my words using sqlite. And all my words are located in the recycler view box but my problem is that i don't know how to separate the words in the recycler view with divider line/seperator
Asked
Active
Viewed 105 times
-2
-
Your question is too vague. You should add more details. – Phantômaxx Jul 10 '17 at 17:45
-
You can check this answer [Link](https://stackoverflow.com/questions/24618829/how-to-add-dividers-and-spaces-between-items-in-recyclervie) – Upendra Shah Jul 10 '17 at 17:48
1 Answers
0
To create a line separator for list items you could use this
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL);
recyclerView.addItemDecoration(dividerItemDecoration);

Giacomo Lai
- 494
- 3
- 15