Top-most and Bottom-most Horizontal Divider does not show up in ListView

前端 未结 5 649
情话喂你
情话喂你 2021-02-08 21:49

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         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-08 22:14

    First you'll have to enable the footerDividers in XML:

    android:footerDividersEnabled="true"
    

    Then simply add a dummy footer view like this

    listview.addFooterView(new View(this), null, false);
    

    You can do the same for header

提交回复
热议问题