Android listView unwanted space between header view

∥☆過路亽.° 提交于 2019-12-23 00:30:06

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/21095214/android-listview-unwanted-space-between-header-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!