CardView Doesn't Appear On Nexus5

408 Views Asked by At

I have been using android.support.v7.widget.CardView in my application and something funny is happening.

I don't see the CardView's in the IDE preview but they show up on all the various devices that my app is running on, such as:

  • Samsung (GS III and IV)
  • Moto G
  • OnePlus 1

But when running on Nexus 5 (which is running Android 5.0) the CardViews don't show as if they aren't even there, but what's inside them is shown.

Does anybody know why that is? I haven't been able to find the reason looking online yet.

Here's the XML of my CardView

<android.support.v7.widget.CardView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        cardView:cardBackgroundColor="#ffffff"
        android:padding="2dp"
        cardView:cardElevation="5dp"
        cardView:cardUseCompatPadding="true">

The Padding and the Elevation don't seem to be working either

1

There are 1 best solutions below

9
On

Use cardview:cardUseCompatPadding="true" in android.support.v7.widget.CardView