Here's how I implemented it ... The bottom divider appears after installing android:paddingBottom for the ListView . BUT in my case, after installing android:paddingTop upper and lower delimiters are not displayed. I do not know why. So I added the following code to my list_item_layout.xml :
<View android:layout_width="match_parent" android:layout_height="1dip" android:background="?android:attr/listDivider" />
and in my adapter, I just change 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 helps someone.
Clans
source share