2

I'm adding 2 different views in my ListView header view but for some reason it create a 20dp space between those 2 views. How should I remove it?

Thanks!

Edit : The 2 views I add don't have any top/bottom padding or margins, I'm asking if there is any special "feature" in the ListView headerView about space/separator between views.

Edit 2: it seems that the space between the view in my header view is tied to the dividerHeight parameter. Why? I mean it should only be applied as rows separator. Is there any way to remove it from my headerView and keep it as actual row separator ? headerDividersEnabled=false don't do anything.

Dimillian
  • 3,616
  • 4
  • 33
  • 53
  • Have you tried removing the margin or setting it to a negative? – Jon Douglas Jan 13 '14 at 15:40
  • no clue without code or an image, check if there is padding or margin you added somewhere – Saqib Jan 13 '14 at 15:41
  • Which margins, the two view I add to the listView don't have any margin – Dimillian Jan 13 '14 at 15:41
  • It would be easier to help you if you provide some code and screen shot but my lucky guess it is listview divider, try set `android:dividerHeight=0dp` in ListView tag – Hellboy Jan 13 '14 at 15:46
  • @Hellboy Yeah this is it, but the things is, why the hell does the divider apply to my listView headerView ? – Dimillian Jan 13 '14 at 15:52
  • Would the following help you? http://stackoverflow.com/questions/4961999/remove-bottom-divider-of-a-android-listview – Xebozone Nov 17 '14 at 18:56

2 Answers2

0

try to set android:headerDividersEnabled="false" in the ListView

Hellboy
  • 1,052
  • 6
  • 12
0

i have same issue i have added dynamic header to listview but on the start of activity it gives space on the top of headerview and we scroll listview then header view overlaps with it instead of going up.

header view of listview having space

Sunil Pal
  • 91
  • 1
  • 6