質問

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

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top