Questions tagged [divider]
357 questions
1029
votes
42 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
- 26,173
- 7
- 28
- 41
98
votes
12 answers
Android ListView Divider
I have this code:
oriharel
- 10,100
- 14
- 45
- 55
96
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,078
- 2
- 25
- 34
96
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,103
- 8
- 46
- 70
82
votes
9 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ć
- 1,897
- 1
- 13
- 24
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
- 4,926
- 4
- 30
- 48
39
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
- 609
- 1
- 10
- 16
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
- 543
- 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,625
- 2
- 18
- 29
31
votes
8 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
- 402
- 1
- 5
- 11
31
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
- 18,980
- 36
- 129
- 231
28
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,478
- 7
- 30
- 42
26
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
- 735
- 2
- 9
- 16
26
votes
7 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:
25
votes
2 answers
Android GridView draw dividers
I'd like to know the simplest way to draw dividers between items (currently textviews) within a GridView. The only way I can think of is to draw borders around those textviews so when combined, they look like continuous horizontal and vertical…
Eric Chen
- 3,333
- 7
- 34
- 56