简体   繁体   中英

How to remove the border in recyclerview (RecyclerView.Adapter)?

I am trying to create message app for the first time and i am stack at this border created by recyclerview. So can someone know how to remove this from recyclerview

recyclerview (RecyclerView.Adapter) UPDATE:

<android.support.v7.widget.RecyclerView
        android:id="@+id/chat_list"
        app:reverseLayout="true"
        android:background="@color/lightgray"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

RecyclerView XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="10dp">

    <LinearLayout
        android:id="@+id/message_single_layout"
        android:orientation="vertical"
        android:gravity="end"
        android:layout_toRightOf="@+id/message_profile_layout"
        android:layout_toEndOf="@+id/message_profile_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

            <TextView
                android:id="@+id/message_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/white_rounded_chat"
                android:gravity="start"
                android:padding="5dp"
                android:paddingLeft="12dp"
                android:paddingStart="12dp"
                android:paddingRight="12dp"
                android:paddingEnd="12dp"
                android:text="Message Text"
                android:textAlignment="textStart"
                android:textColor="@color/white"
                android:textSize="16sp" /> 

        <TextView
            android:id="@+id/time_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="00:00"
            android:padding="5dp"
            android:textSize="12sp" />

    </LinearLayout> 
</RelativeLayout>

Try to set

recylerview.addItemDecoration(null);

Or

 RecyclerView.ItemDecoration decoration = new RecyclerView.ItemDecoration() {
        @Override
        public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
            super.onDraw(c, parent, state);
        //empty
        }
    };

    simpleListView.addItemDecoration(decoration);

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