Hello I am am working on demo application in which i am using the card view of support library. By default it is adding shadow around it. I want to remove this shadow & shou
You have to use the following attributes
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="0dp"
app:cardCornerRadius="0.5dp"
app:cardPreventCornerOverlap="false"
>
</android.support.v7.widget.CardView>
Try to put the elevation in Xml.
app:cardElevation="0dp"
OR
cardView.setCardElevation(0);
And check you are using the latest CardView library.
use app:cardElevation="0dp", don't use app:elevation="0dp"
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="2dp">
....`
</android.support.v7.widget.CardView>
Just put this line inside your CardView:
app:cardElevation="0dp"
Hope it will help you.
use this attribute in XML
card_view:cardElevation="0dp"
and remember add xmlns:card_view="http://schemas.android.com/tools"
in your root layout.
OR you can call cardView.setCardElevation(0)
to disable shadow programmatically.
cardView.setElevation()
method and CardView attribute android:elevation
will throw java.lang.NoSuchMethodError in platform before Android 5.0