-2

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

1 Answers1

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