I want to have a CardView that contains an ImageView that overlaps the left border of the CardView. I want to do this by providing ImageView with a negative margin. This works fine with all other layouts (LinearLayout / RelativeLayout / FrameLayout) by setting clipChildren = "false".
However, I cannot get it to work with CardView. ImageView will be cropped and will not overlap CardView.
<android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:clipChildren="false"> <ImageView android:layout_marginLeft="-10dp" android:background="@drawable/some_picture" android:layout_width="50dp" android:layout_height="50dp"/> </android.support.v7.widget.CardView>
android margin android-cardview
tymm
source share