Weird black line on top of list view

后端 未结 3 1015
梦如初夏
梦如初夏 2021-01-26 21:58

I am creating a layout with a ListView and at the very top of the list there is this weird black line that I can\'t seem to figure out how to get rid of! It\'s par

相关标签:
3条回答
  • 2021-01-26 22:41

    if you specify attribute dividerHeight in ListView

    <ListView android:dividerHeight="0.0px" android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent"/>

    in layout xml it is not working for Android 2.2 for some reason Google groups say that it will be fixed in next cupcake

    function ListView.setDividerHeight(0) works fine

    0 讨论(0)
  • 2021-01-26 22:48

    It is probably coming from the divider of ListView. Check out and play with setting

    setDividerHeight(0) 
    

    as well as check header/footer dividers are off or use

    setFooterDividersEnabled(false)
    

    You can also set these in xml of course. e.g.

    android:dividerHeight="0"
    
    0 讨论(0)
  • 2021-01-26 22:55

    The problem is not the divider.

    I was also looking for a solution to this and I found one :

    You can do your own theme with this

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    
        <style name="Theme" parent="android:Theme">
            <item name="android:windowNoTitle">true</item>
            <item name="android:windowContentOverlay">@null</item>
        </style>
    
    </resources>
    

    And setting the theme to your manifest xml file and it works.

    The windowContentOverlay to null fix the problem.

    0 讨论(0)
提交回复
热议问题