If you're setting the card background programmatically, make use you use cardView.setCardBackgroundColor()
and not cardView.setBackgroundColor()
and make sure use using app:cardPreventCornerOverlap="true"
on the cardView.xml. That fixed it for me.
Btw, the above code (in quotations) is in Kotlin and not Java. Use the java equivalent if you're using Java.