How can I hide the top divider of a ListView?

How do I hide the top divider ListView

? I was able to hide the bottommost divider ListView

using listView.setFooterDividersEnabled(false)

. However, use listView.setHeaderDividersEnabled(false)

will not hide the top divider. Note that I have not added any view for my header and footer.

Below is an example of a ListView taken from a Samsung Galaxy S2: (I mean the splitter on top of the Wi-Fi sleep policy.)

enter image description here

+3


source to share


1 answer


The top separator in the image above is not a header separator. This is S2 version for scroll effect. So setting the header separator to false won't work here. Setting the divider height to 0 will hide it, but at the cost of hiding all other separators. Unfortunately, setOverScrollMode

only available from API 9 and up. As such, you cannot control the scrolling behavior on API 8 and below.



+1


source







All Articles