0

I implemented a LisView that has nested card views with a custom ImageView for the shadow. Here's the layout :

  <android.support.v7.widget.CardView
        android:id="@+id/food_card_view"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="2dp"
        card_view:cardBackgroundColor="@android:color/transparent"
        card_view:cardCornerRadius="0dp"
        card_view:cardElevation="0dp"
        card_view:cardPreventCornerOverlap="false">

(... views here ...)

</android.support.v7.widget.CardView>

The problem is that the CardView shows has an elevation value on some devices, even if card_view:cardElevation="0dp" is set to 0dp.

enter image description here

Ion Farima
  • 309
  • 1
  • 4
  • 12
  • 1
    Why are you using CardView if you dont want the shadow effect? That is the whole point of card view – Martin De Simone Feb 20 '17 at 05:23
  • You're right, I missed some steps ahah. I mean, I first implemented the RecyclerView and then changed to ListView because of some problems with recycling the items and I didn't realize that I simply could delete the CardView and replace it with a normal layout. Thanks ;) – Ion Farima Feb 20 '17 at 12:51

1 Answers1

0

I found the solution by deleting the CardView from the layout and inflating directly the LinearLayout that holds the item list view.

Ion Farima
  • 309
  • 1
  • 4
  • 12