15

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.

5
  • 4
    @desgraci please, bear in mind that we're here to help you, only if you are willing to collaborate. In my opinion, this visual hacks tend to be selfexplanatory with a couple of pictures of what you are trying to achieve, and what you are currently doing. They don't need to be very well drawn, just enough to understand what's going on. You can have a look at a picture I added to a question I posted. It's fairly simple, yet easy to understand. PS: Being rude or feeling nervous won't help anyone of us. Aug 8, 2012 at 14:30
  • @Kor i edited the question to include your suggestion.
    – desgraci
    Aug 8, 2012 at 14:39
  • 1
    good to know. This truly clarifies (at least) me your goals. I am not used to use footers or headers in listviews, but maybe a simple styling for your footer could do the trick. Set android:footerDividersEnabled="false" and then style your custom footer view with a top border. But hey, I'm just talking for the sake of it, don't take mine as an answer, because I cannot give it a try right now to check if it works. Aug 8, 2012 at 14:47
  • Yeah, that may do the trick, but it would be another hack, that is what i don't want, not sure what issues can bring this in the future. OFC this does the trick and is by far better than what i'm using... But asking again "There's no way to specify android to don't show the bottom divider of the footer?, or to remove the bottom divider of the footer in an android listview" it has to be done via hack?
    – desgraci
    Aug 8, 2012 at 15:02
  • @dnkoutso "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." Please read the question and the reason this don't work. I was not asking for a magic flag, but a serious solution of a real problem, because the hacks don't work in all the scenarios. Don't be rude please.
    – desgraci
    Aug 21, 2012 at 17:31

2 Answers 2

10

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

3
  • 2
    Very late but this is wrong. This will remove the divider BEFORE the footer as well.
    – Tariq
    Aug 12, 2015 at 21:42
  • 2
    Instead as noted elsewhere use android:height="wrap_content" on your ListView
    – Tariq
    Aug 13, 2015 at 17:28
  • 4
    What the actual f*ck, android:height="wrap_content" WORKED... But WHY?!?!?!? omg
    – BoD
    Apr 15, 2016 at 13:20
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.