0

I understand that there is supposed to be a white padding on pre-lollipop devices to support corner radius but I am testing on a Lollipop device and my cardview has a padding. Please see the code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llFeedItemCardTheme"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/cvFeedItem"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:layout_marginBottom="-2dp"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    android:background="#FFFFFF"
    card_view:cardCornerRadius="6dp"
    card_view:cardElevation="2dp"
    card_view:cardUseCompatPadding="true">

    <TextView
        android:id="@+id/tvFeedJoke"
        style="?android:attr/borderlessButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_vertical"
        android:padding="10dp"
        android:text="Being Human t shirt"
        android:textAllCaps="false"
        android:textAppearance="?android:attr/textAppearanceLarge" />


</android.support.v7.widget.CardView> 
</LinearLayout>

I am also attaching a screenshot. Please note that I don't want to use card_view:cardPreventCornerOverlap="false" because I don't want to lose rounded corners.

See the image below, when I touch the textview the effect shows that there is a padding. screenshot

Usman
  • 2,331
  • 2
  • 21
  • 29
  • did you read this answer? http://stackoverflow.com/a/26855277/2091181 – Jorge Casariego Nov 10 '15 at 16:31
  • Thank you but this doesn't work. I have tried putting `card_view:contentPaddingLeft="0dp"`, `card_view:contentPaddingRight="0dp"` and so on but it has no effect on the view. – Usman Nov 11 '15 at 15:07

0 Answers0