I have a simple layout with CardView
<android.support.v7.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:id="@+id/cv_tag"
android:layout_width="wrap_content"
android:layout_height="@dimen/tag_height"
android:layout_margin="4dp"
android:clickable="true"
app:cardCornerRadius="20dp"
app:cardElevation="2dp">
<FrameLayout
android:id="@+id/fl_selection_indicator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="8dp"
android:textAppearance="@style/PrimaryWhiteText.Tiny"
tools:text="Hard"/>
</FrameLayout>
</android.support.v7.widget.CardView>
And it's rendering not as I expect it to. It looks like system wraps this layout into FrameLayout with elevation and white background. Interesting thing is if I wrap this layout into FrameLayout by myself elevation goes away but white background is still there (Background of frame layout not CardView)
How to remove elevation and white background and why is it happening?
Thanks in advance!