I've a image where i would like to add black transparent at bottom to show the text details. From the server i will get the normal images which i would like to convert it like below. In below image you can see that the bottom of the image has black transparent.
try this
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ur_image" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/gradient_bg" >
</FrameLayout>
and gradient_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="90"
android:centerColor="#59000000"
android:endColor="@android:color/transparent"
android:startColor="#000000" />
</shape>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With