Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the bottom divider of the footer in an android listview

As simple as that. Of course using android:footerDividersEnabled="false" wont work on this one, cause it will remove both upper and bottom dividers.

I made this question yesterday, can't remember who tried to answer it but i had to erase it cause a troll started downgrading the question cause it was "unclear" (if you don't know what is a divider or a footer, or bottom, or what is android, yes it can be...)

Anyway if that was the case let's picture a 2 items listview and i want to give a space with a footer, but without the footer showing the bottom line that corresponds to the bottom divider, but keeping the other dividers, also, have in mind that is just how to remove that, i can make a hack to use 2xviews and use the even as dividers as suggested, but for me that doesn't make sense, it would be more efficient just to add an extra empty view + footer of 1px + the footerDividersEnabled as i'm doing now, but that is just a plain hack, and it is becoming unmanagable. Also adding a line to the top of the Layout of the footer won't work cause you will have a space when the listView items contains color or similars on their background, because you will see the background color where the divider was supposed to be.

There's no way to specify android to don't show the bottom divider of the footer?

Please try to understand that this is not the same question as:

Remove the bottom divider of an android ListView

Before going troll without reading and downgrading.

@Kor lets say that the footer looks like these normally:
CASE 1:


ListItemN


Footer




Using the android:footerDividersEnabled="false" looks like this:
CASE 2:


ListItemN

Footer


And i want a way to have it like this:
CASE 3:


ListItemN


Footer



But only have found the hacky ways described above. I hope this helps, if it doesn't let me know what else do you need.

like image 631
desgraci Avatar asked Aug 08 '12 14:08

desgraci


2 Answers

Just use this to avoid divider lines of list view android:footerDividersEnabled="false"

  <ListView
                android:id="@+id/listHomeListViewController"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@+id/ImageView01"
                android:cacheColorHint="@android:color/transparent"
                android:footerDividersEnabled="false" >
            </ListView>

//vKj

like image 176
Vinod Joshi Avatar answered Oct 21 '22 17:10

Vinod Joshi


You have to use a hack. What you are trying to achieve something that goes against the regular behavior.

The simplest solution has already been described by @Kor. Simply make the row layout with a top header.

like image 37
Warpzit Avatar answered Oct 21 '22 16:10

Warpzit