Setting Elevation in XML on AppCompat CardView on Android 5.0

It looks like a margin/padding problem, try to set the cardUseCompatPadding attribute to true. E.g.: <android.support.v7.widget.CardView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:card_view=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_margin=”6dp” card_view:cardUseCompatPadding=”true” card_view:cardElevation=”4dp” card_view:cardCornerRadius=”3dp”> Explanation from Android doc : CardView adds additional padding to draw shadows on platforms before L. This may cause Cards to have different sizes between L and before L. If you … Read more

How to disable the shadow around card view in android

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

Transparent background on CardView – Android

Setup your CardView to use the cardBackgroundColor attribute to remove color and cardElevation attribute to remove the drop shadow. For example: <android.support.v7.widget.CardView xmlns:card_view=”http://schemas.android.com/apk/res-auto” xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/myCardView” android:layout_width=”match_parent” android:layout_height=”match_parent” card_view:cardBackgroundColor=”@android:color/transparent” card_view:cardElevation=”0dp”> For a full list of supported attributes see here: https://developer.android.com/reference/android/support/v7/widget/CardView.html If you are using an older API, you will need to call these two functions on … Read more

CardView Corner Radius

Unless you try to extend the Android CardView class, you cannot customize that attribute from XML. Nonetheless, there is a way of obtaining that effect. Place a CardView inside another CardView and apply a transparent background to your outer CardView and remove its corner radius (“cornerRadios = 0dp”). Your inner CardView will have a cornerRadius … Read more

CardView layout_width=”match_parent” does not match parent RecyclerView width

The docs for inflate: Inflate a new view hierarchy from the specified xml resource. Throws InflateException if there is an error. Parameters resource ID for an XML layout resource to load (e.g., R.layout.main_page) root view to be the parent of the generated hierarchy (if attachToRoot is true), or else simply an object that provides a … Read more

CardView not showing Shadow in Android L

After going through the docs again, I finally found the solution. Just add card_view:cardUseCompatPadding=”true” to your CardView and shadows will appear on Lollipop devices. What happens is, the content area in a CardView take different sizes on pre-lollipop and lollipop devices. So in lollipop devices the shadow is actually covered by the card so its … Read more

CardView background color always white

If you want to change the card background color, use: app:cardBackgroundColor=”@somecolor” like this: <android.support.v7.widget.CardView android:layout_width=”match_parent” android:layout_height=”wrap_content” app:cardBackgroundColor=”@color/white”> </android.support.v7.widget.CardView> Edit: As pointed by @imposible, you need to include xmlns:app=”http://schemas.android.com/apk/res-auto” in your root XML tag in order to make this snippet function

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)