3

How do I hide the topmost divider of ListView? I was able to hide the bottommost divider of the ListView by using listView.setFooterDividersEnabled(false). However, using listView.setHeaderDividersEnabled(false) won't hide the topmost divider. Please note that I did not add any view for my header and footer.

Below is a sample ListView I took from Samsung Galaxy S2: (I am referring to the divider on top of Wi-Fi sleep policy.)

enter image description here

Arci
  • 6,647
  • 20
  • 70
  • 98
  • http://stackoverflow.com/questions/4625832/hiding-listview-header-hiding-single-divider-in-a-list – Lalit Poptani Apr 03 '12 at 02:42
  • @LalitPoptani: Thanks! But I can't use the answer on the link you provided because it will be a very tedious task to hide the original divider and then add a view for each list to act as a divider. I am using a base class to generate my activities. As such, doing it will require to update all the other classes using the said base class. I am looking if there is a simple way to solve my problem. If it is possible, I prefer if it is not a trick or hack. I will still wait for some answers. – Arci Apr 03 '12 at 03:05
  • Hey, AFAIK that list-view doesn't content topmost divider by default, its better if you show us screen shot of your issue,so we get more clear about your issue? – RobinHood Apr 03 '12 at 05:07
  • @RobinHood: Thanks! I've already attached a picture of a sample ListView. – Arci Apr 03 '12 at 05:58

1 Answers1

1

The topmost divider on the image above is not a header divider. It is the version of S2 for overscroll effect. So setting the header divider to false here won't work. Setting the divider height to 0 will hide it but at the expense of hiding all the other dividers. Unfortunately, setOverScrollMode is only available from API 9 and up. So you have no control over the over scroll behavior on API 8 and below.

Arci
  • 6,647
  • 20
  • 70
  • 98