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_horiz
Here's how I implemented it...
Bottom divider shows up after setting android:paddingBottom
for the ListView
. BUT in my case after setting android:paddingTop
top and bottom dividers are not showing. I don't know why.
So I added in my list_item_layout.xml
the following code:
and in my adapter I just changing the visibility of this view:
View topDivider = v.findViewById(R.id.divider);
if (position == 0) {
topDivider.setVisibility(View.VISIBLE);
} else {
topDivider.setVisibility(View.GONE);
}
Hope this will helpfull to someone.