问题
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