I am using a cardview as the root of a custom view I am writing. I using the v7 support library. My XML looks like this:
use cardBackgroundColor="color" in xml card_view sample code :