I am using a ListView. But the top-most and bottom-most horizontal bar does not show up. Why? I am using this:
android:divider="@android:drawable/divider_horizontal_bright"
I am using a ListView. But the top-most and bottom-most horizontal bar does not show up. Why? I am using this:
android:divider="@android:drawable/divider_horizontal_bright"
Add a dummy footer and header
Here's how I implemented it... Bottom divider shows up after setting
android:paddingBottom
for theListView
. BUT in my case after settingandroid:paddingTop
top and bottom dividers are not showing. I don't know why. So I added in mylist_item_layout.xml
the following code:and in my adapter I just changing the visibility of this view:
Hope this will helpfull to someone.
Have you looked into setting
android:headerDividersEnabled
andandroid:footerDividersEnabled
on theListView
?Also, if you look for
drawDivider
in platform/frameworks/base/+/master/core/java/android/widger/ListView.java in the Android open source repository, you'll be able to find some more clues.I had the same problem with LibSlideMenu.
As
android:headerDividersEnabled
set to true did not show the header divider in the Sliding Menu, I solved it by changingslidemenu.xml
(notslidemenu_listitem.xml
) toThis will add the divider manually.