I am new to Android development and developing my first Android app. I have the background color in the View in the xml layout as follows.
android:background="@+color/bgColor"
Now I have a full-sized transparent background image that I want to lay over the background, and then other elements above this image.
Is there a way that I can use both the background color and the background image in the same layout.
Thanks at Advance.
You can use ImageView with background color:
<ImageView layout_width="match_parent" layout_height="match_parent" src="@drawable/myImage" background="@color/myBgColor" />
Another option is to set the background color in the root element of your layout and save the src in your ImageView.
I am using AppCompatImageView . Against this background, the color can be set using the property below.
AppCompatImageView
android:backgroundTint="@color/colorPrimary"