I would like to know how to apply or emulate foreground effect in a view different from FrameLayout, as LinearLayout or RelativeLayout
This is what I have now:
<?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>
And I want something like:
<?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>
Thanks in advance!!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…