2014-04-20 53 views
0

我想删除行结束列表视图,安卓4.2.2阿比17:拆除分隔线; Android的列表视图(滑动菜单)

我已经试过:

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

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

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

and

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

但不工作,

这是我的布局:

<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> 

感谢您的任何意见。

回答

0

你想删除列表视图处的bettom线?尝试使用WRAP_CONTENT而不是match_parent的列表视图

+0

是的layout_height,但改变到Android:layout_height =“WRAP_CONTENT”不工作, –