I want to add an image as a background of an activity, and I want to add another image .png over it
Asked
Active
Viewed 173 times
-6
-
Read https://stackoverflow.com/help/how-to-ask – ADM Mar 14 '18 at 10:53
-
`How to add a mask over background image in activity?` add a layout with transparent background !! https://stackoverflow.com/questions/15852122/hex-transparency-in-colors try this – Santanu Sur Mar 14 '18 at 10:54
-
1@MatarUano Please [BE NICE](https://stackoverflow.com/help/be-nice) to community users, everyone here is volunteering to help you. – global_warming Mar 14 '18 at 11:06
1 Answers
0
Just add two imageview
on top of each other using a relative layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:scaleType="centerCrop"
android:src="@drawable/settings"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:alpha="0.5"
android:background="@color/colorPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

Navneet Krishna
- 5,009
- 5
- 25
- 44