6

I really don't know why, but I have a strange line between my list items.

Can somebody guess what it is?

Here is a picture: http://www.directupload.net/file/d/3892/aznspclv_png.htm

My chat_list_item.xml seems to be ok:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayoutChat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray" >

<com.android.volley.toolbox.NetworkImageView
    android:id="@+id/imgViewChatProfileIcon"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="10dp"
    android:src="@drawable/icon_profile" />

<LinearLayout
    android:id="@+id/chatBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/chat_box"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Text 1"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/lightblue" />

    <TextView
        android:id="@+id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:text="Text 2"
        android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>

Maximus1809
  • 575
  • 1
  • 10
  • 30
  • Please go through this http://stackoverflow.com/questions/1914477/how-to-remove-line-inbetween-two-listviews-in-android/19076057#19076057 – sandeepmaaram Feb 08 '15 at 11:30

2 Answers2

15

Set these attribute to your ListView in the layout xml to remove the line:

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

Or these to change its color and thickness:

android:divider="#FF9900"
android:dividerHeight="2px"
Thanos
  • 3,627
  • 3
  • 24
  • 35
1

It's called Divider.

To remove it from xml:

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

Or from java:

getListView().setDividerHeight(0);
getListView().setDivider(null);
Rami
  • 7,879
  • 12
  • 36
  • 66