Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Border in RecycleView Android

I’m using RecycleView, there shouldn’t be a border after each item in the recycle view, but I have. How to remove it? I think the problem is in the LayoutManager because there is not border in the last element of RecycleView

<androidx.recyclerview.widget.RecyclerView
                android:background="@color/menu_background" //here is non border
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                tools:listitem="@layout/cabin_category_info_layout" />

And it’s CardView

<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp">

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If you use CardView you should know that there’s a default corner on this View so if you don’t want it you should configure it to don’t show it.

Try adding this into your CardView

app:cardCornerRadius="0dp

Also if you want to remove the elevation you may use this too

app:cardElevation="0dp"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading