So legen Sie das Vordergrundattribut für eine andere Ansicht als FrameLayout fest

Ich möchte wissen, wie Vordergrundeffekte in einer anderen Ansicht als FrameLayout, als LinearLayout oder RelativeLayout angewendet oder emuliert werden

Das habe ich jetzt:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/cardContent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/row_background"
    android:foreground="@drawable/foreground_row">

    ...

</FrameLayout>

Und ich möchte so etwas wie:

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/cardContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/row_background"
        app:foreground="@drawable/foreground_row">

        ...

    </RelativeLayout>

Danke im Voraus!!

Antworten auf die Frage(3)

Ihre Antwort auf die Frage