I am new to android development and am developing my first android application. I have the background color of the View set in the layout's xml 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 over that image.
is there a way i can use both background color and background image in the same layout.
Thanks in Advance.
You can use an ImageView with a 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 keep the src in your ImageView.
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