Wie bringt man imageView vor die Kartenansicht? Wenn beide von Relative Layout sind childs
Ich habe ein Layout XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/containor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff6da"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.vats.vatishs.cardviewprogrammatically.MainActivity">
<FrameLayout
android:id="@+id/card"
android:layout_width="220dp"
android:layout_marginTop="10dp"
android:layout_height="wrap_content">
<TextView
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:text="Hello I am a text View." />
</FrameLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="210dp"
android:background="@drawable/select_delete_chim" />
</RelativeLayout>
was gut funktioniert. Das Ergebnis ist eine Bildansicht über dem Rahmenlayout, aber wenn ich die folgende XML verwende, muss ich das Rahmenlayout durch CardView ersetzen:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/containor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff6da"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.vats.vatishs.cardviewprogrammatically.MainActivity">
<android.support.v7.widget.CardView
android:id="@+id/card"
android:layout_width="220dp"
android:layout_marginTop="10dp"
android:layout_height="wrap_content">
<TextView
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:text="Hello I am a text View." />
</android.support.v7.widget.CardView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="210dp"
android:background="@drawable/select_delete_chim" />
</RelativeLayout>
dann lautet das Ergebnis: ImageView auf der Rückseite von CardView.
Irgendeine Lösung dafür?
Eine Sache mehr, es wird gut funktionieren auf Pre-Lollipop-Geräten, aber auf Lollipop funktioniert es nicht.
Ausgabe mit CardView auf Geräten vor dem Lutscher (erforderliche Ausgabe)