简体   繁体   中英

Remove divider line; android listview(sliding menu)

I want to remove line end listview, android 4.2.2 Api 17:

I've tried :

getListView().setDivider(null);
getListView().setDividerHeight(0);

and

android:divider="@null"
android:dividerHeight="0dp"

and

android:divider="#00000000"
android:dividerHeight="0dp"

and

android:divider="@android:color/transparent"
android:dividerHeight="0dp" 

But not working,

This my layout :

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context=".MainActivity" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/drawer_text" />
    </RelativeLayout>

    <ListView
        android:id="@+id/drawer"
        android:layout_width="250dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#F3F3F4"
        android:choiceMode="singleChoice"
        android:divider="#00000000"
        android:dividerHeight="0dp"
        />

</android.support.v4.widget.DrawerLayout>

thanks for any advice.

Do you want to remove the bettom line at listview? try to use wrap_content instead of match_parent for layout_height of listview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM