Ich habe xml Gradient ziehbar Ressourcendatei hier:Set Imageview Vordergrund Farbverlauf programmatisch
Datei: fg_graidient
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="linear"
android:centerX="0%"
android:startColor="#00020321"
android:centerColor="#F2000000"
android:endColor="#B2020321"
android:angle="45"/>
</shape>
kann ich die Imageview Vordergrund wie unten:
<ImageView
android:id="@+id/backimg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:scaleType="fitXY"
android:foreground="@drawable/fg_graidient"
/>
Aber Ich möchte diesen kachelbaren Vordergrund für die Bildansicht programmgesteuert festlegen. Ist es möglich?
überprüfen meine Antwort –