Questions tagged [divider]

393 questions
1115
votes
45 answers

How to add dividers and spaces between items in RecyclerView

This is an example of how it could have been done previously in the ListView class, using the divider and dividerHeight parameters:
EyesClear
  • 28,077
  • 7
  • 32
  • 43
113
votes
17 answers

RecyclerView remove divider / decorator after the last item

I have a quite simple RecyclerView. This is how I set the divider: DividerItemDecoration itemDecorator = new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL); itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(),…
Slobodan Antonijević
  • 2,533
  • 2
  • 17
  • 27
101
votes
5 answers

Remove the bottom divider of an android ListView

I have a fixed height ListView. It has divider between list items, but it also displays dividers after the last list item. Is there a way to not display a divider after the last item in ListView?
mkso
  • 3,178
  • 4
  • 27
  • 35
99
votes
11 answers

How to add (vertical) divider to a horizontal LinearLayout?

I'm trying to add a divider to a horizontal linear layout but am getting nowhere. The divider just doesn't show. I am a total newbie with Android. This is my layout XML:
Ahmed-Anas
  • 5,471
  • 9
  • 50
  • 72
98
votes
12 answers

Android ListView Divider

I have this code:
oriharel
  • 10,418
  • 14
  • 48
  • 57
42
votes
9 answers

Add margins to divider in RecyclerView

i am building an android app which is using RecyclerView. I want to add dividers to RecyclerView, which I did using this code: DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),…
Random Guy
  • 560
  • 1
  • 5
  • 11
42
votes
3 answers

How do I remove the divider from a listview on android?

I'm developing a app that have a Listview, and the items from list already have a style I don't need the divider. How do I set as hidden or remove the divider from the ListView?
FilipeFaria
  • 639
  • 1
  • 10
  • 16
40
votes
2 answers

How to get dividers in NavigationView menu without titles?

I am using the new NavigationView to create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the sections of my app, and the settings and help & support links at the bottom. In all…
Jeff Lockhart
  • 5,379
  • 4
  • 36
  • 51
39
votes
8 answers

Remove ion item divider

How I can remove divider? I have the following code to show 4 items in a row:
TheUnreal
  • 23,434
  • 46
  • 157
  • 277
34
votes
6 answers

Empty space between listview header and first item

I've created an android application with a ListView. I've added both a header and footer to the list. But when adding a divider/separator it also creates an empty space between the header and the first ListView item. It does the same for the last…
Niles11
  • 553
  • 1
  • 6
  • 17
33
votes
5 answers

Listview divider margin

I'm trying to set a margin to a listview divider. The divider is a dashed line:
Fabian
  • 2,693
  • 2
  • 21
  • 33
31
votes
8 answers

How to add dividers between specific menu items?

Background I have a menu item in the action bar (toolbar actually) that when clicked, shows a list of items to choose from, similar to radio-buttons:
android developer
  • 114,585
  • 152
  • 739
  • 1,270
29
votes
6 answers

How to show divider between spinner items?

I using listviews and expandedviews that has dividers and I can set them but on spinner its looks like it is no divider between items. Someone that has a idea of how to fix this?
RickardP
  • 2,558
  • 7
  • 34
  • 42
27
votes
3 answers

insert vertical divider line between two nested divs, not full height

I have float left and float right
nested within a light blue box div as shown in the image below. I can't figure out how to insert a vertical line between them as shown in this image: That has the following properties: 1) padding/margin on…
Tim Koelkebeck
  • 795
  • 2
  • 9
  • 18
27
votes
4 answers

Android radiogroup, divider between radiobuttons

Is there a simple way to add a divider between RadioButtons inside a RadioGroup? I've tried using the divider xml attribute and it doesn't seem to be working. In case it's relevant, the RadioGroup in my layout does not contain any child views; I'm…
Karakuri
  • 38,365
  • 12
  • 84
  • 104
1
2 3
26 27