I want to add the transparent black color on top of the image and make it darker.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/rest_image"
android:layout_width="match_parent"
android:layout_height="150dp"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
/>
</RelativeLayout>
I can set the alpha parameter but the color change is in white. I want to make the darker image like this. How can i do it in xml or Java code. I will set it based on condition.?
Thanks.
What you need is called tinting. Apply a tint to your ImageView
:
<ImageView
...
app:tint="#6F000000"
/>
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